Skip to content

Conversation

@jakub-nt
Copy link
Contributor

Depends on #234.

@jakub-nt jakub-nt changed the title Minor code quality improvements. Minor code quality improvements Jun 23, 2025
@olehermanse olehermanse requested review from larsewi and olehermanse and removed request for olehermanse June 23, 2025 17:36
@jakub-nt jakub-nt force-pushed the minor-code-q-improvements branch from 37bce8d to 84fe212 Compare June 23, 2025 17:49
Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase now that the related PRs are merged :)

Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this 🚀

assert strip_left(s, "b") == "abab"


def test_read_file():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add edge case where path is:

  • not a regular file
  • binary file

jakub-nt added 4 commits June 24, 2025 15:28
…brary implementations

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…` home directory so that \`path_append\` function name is not misleading

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…ild step splitting

Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
@jakub-nt jakub-nt force-pushed the minor-code-q-improvements branch from 84fe212 to 5834964 Compare June 24, 2025 14:19
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>


def path_append(dir, subdir):
dir = os.path.abspath(os.path.expanduser(dir))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to make this change here, however we might reverse it in the future. It does seem useful that path_ functions do some sensible normalizations of the paths, especially the expanduser one - ~/ can cause stuff to break in unexpected ways. Now it's just a wrapper of os.path.join().

@olehermanse olehermanse merged commit 952f6a5 into cfengine:master Jun 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants