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

scripts: west_commands: runners: Fix python linter issues #81667

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

pdgendt
Copy link
Collaborator

@pdgendt pdgendt commented Nov 20, 2024

This PR applies a series of fixes to python files located under scripts/west_commands/runners, see the individual commits for details.

These ignores were added with an older version of pylint and are
either removed or ignored by default.

Signed-off-by: Pieter De Gendt <[email protected]>
Variables are possibly unbound, initialize to None.

Signed-off-by: Pieter De Gendt <[email protected]>
Prefer AssertionError instead of assert False.

See https://docs.astral.sh/ruff/rules/assert-false/

Signed-off-by: Pieter De Gendt <[email protected]>
Convert except: pass statement so the conditional import results in a
NoneType.

Signed-off-by: Pieter De Gendt <[email protected]>
Use standard library variants for list, dict, tuple, set

See https://docs.astral.sh/ruff/rules/non-pep585-annotation/

Signed-off-by: Pieter De Gendt <[email protected]>
Replace .format() calls with f-strings.

See https://docs.astral.sh/ruff/rules/f-string/

Signed-off-by: Pieter De Gendt <[email protected]>
All linter issues in scripts/west_commands/runners are fixed and can be
removed from the exclusion list.

Signed-off-by: Pieter De Gendt <[email protected]>
@pdgendt pdgendt force-pushed the ruff-scripts-west_commands-runners branch from e1e4401 to bf5f923 Compare November 21, 2024 13:16
@pdgendt
Copy link
Collaborator Author

pdgendt commented Nov 21, 2024

Rebased on main

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Very educational, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants