Skip to content

Conversation

@bernhardkaindl
Copy link
Contributor

@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.

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
@bernhardkaindl bernhardkaindl merged commit b0a3c55 into xenserver:master May 13, 2024
@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