Skip to content

koji: Lint koji_build.py file a bit and relax linter#775

Draft
rzr wants to merge 1 commit intomasterfrom
phcoval/review/master
Draft

koji: Lint koji_build.py file a bit and relax linter#775
rzr wants to merge 1 commit intomasterfrom
phcoval/review/master

Conversation

@rzr
Copy link
Copy Markdown
Contributor

@rzr rzr commented Nov 28, 2025

This is a first pass fixing important and low hanging fruits. Pylint now passing (with relaxed header).

It will be appreciated if future changes can pass linter, and feel free to make it strictier.

This is a first pass fixing important and low hanging fruits.
Pylint now passing (with relaxed header).

It will be appreciated if future changes can pass linter, and feel
free to make it strictier.

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
@stormi
Copy link
Copy Markdown
Member

stormi commented Nov 28, 2025

Have you talked with Yann and Gaëtan about it? There may be a need for coordination with the broader linting efforts.

# prev_branch is empty when the head was detached
subprocess.check_call(['git', 'checkout', prev_branch or commit])


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doubling newlines is not a rule we chose to enforce at the moment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok i can revert this, fyi flake8 complained about that

return f'{spec.release}.0.{test_build_id}.{build_nb}'
else:
return f'{spec.release}~{pre_build_id}.{build_nb}'
return f'{spec.release}~{pre_build_id}.{build_nb}'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We avoided an else, but do we need to enforce that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure we can skip it

scripts/koji/koji_build.py:145:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)

Comment thread scripts/koji/koji_build.py
@stormi stormi requested a review from a team November 28, 2025 18:23
@rzr rzr requested a review from glehmann November 28, 2025 18:53
@glehmann
Copy link
Copy Markdown
Member

We haven't updated the project configuration in this repository, as we did in most other python projects, like xcp-ng-tests or xcp-ng-build-env.
I think it's worth updating it to match the configuration in the other repositories.

@rzr rzr marked this pull request as draft January 15, 2026 15:27
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.

3 participants