Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/test_ifrename_dynamic: Merge duplicate code into common functions #132

Conversation

bernhardkaindl
Copy link
Collaborator

@bernhardkaindl bernhardkaindl commented May 9, 2024

tests/test_ifrename_dynamic: Merge duplicate code into two small common functions

The duplicated code was detected by a specialized tool, and it prepared merging them for me as well.

I reviewed the work and moved the common functions so that the change is easy to review.

$ git log -n1 -p | diffstat
  pyproject.toml                 |    2 +-
  tests/test_ifrename_dynamic.py |   44 ++++++++++++++------------------------------
  2 files changed, 15 insertions(+), 31 deletions(-)

The change to pyproject.toml is needed to make the max-columns for black less wide:
It stops black from create an overlong joined line in the context of the diff.

The plan would be anyways to make the code formatting less wide.
It's a good find that the columns (were 96) was too wide, and this improves it.

@bernhardkaindl bernhardkaindl merged commit b0a3c55 into xenserver:master May 13, 2024
6 checks passed
@bernhardkaindl bernhardkaindl deleted the test_DynamicRules-merge-duplicate-code branch May 13, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants