-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
pdgendt
wants to merge
31
commits into
zephyrproject-rtos:main
Choose a base branch
from
pdgendt:ruff-scripts-west_commands-runners
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
scripts: west_commands: runners: Fix python linter issues #81667
pdgendt
wants to merge
31
commits into
zephyrproject-rtos:main
from
pdgendt:ruff-scripts-west_commands-runners
+405
−540
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zephyrbot
added
platform: GD32
GigaDevice
platform: Synopsys
Synopsys
area: CAN
area: West
West utility
platform: Intel ADSP
Intel Audio platforms
labels
Nov 20, 2024
zephyrbot
requested review from
abrodkin,
alexanderwachter,
cameled,
carlescufi,
dcpleung,
evgeniy-paltsev,
gmarull,
henrikbrixandersen,
martinjaeger,
mbolivar-ampere,
nandojve,
ruuddw,
soburi,
str4t0m and
swinslow
November 20, 2024 16:01
pdgendt
force-pushed
the
ruff-scripts-west_commands-runners
branch
4 times, most recently
from
November 20, 2024 18:52
9d340c5
to
e1e4401
Compare
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]>
…027) The empty function is intentional. https://docs.astral.sh/ruff/rules/empty-method-without-abstract-decorator/ Signed-off-by: Pieter De Gendt <[email protected]>
Don't pass default open mode. See https://docs.astral.sh/ruff/rules/redundant-open-modes/ Signed-off-by: Pieter De Gendt <[email protected]>
Replace printf-style string format. See https://docs.astral.sh/ruff/rules/printf-string-formatting/ Signed-off-by: Pieter De Gendt <[email protected]>
Do not use setattr for constants. See https://docs.astral.sh/ruff/rules/set-attr-with-constant/ Signed-off-by: Pieter De Gendt <[email protected]>
…(E701) Place if and conditional statements on separate lines. https://docs.astral.sh/ruff/rules/multiple-statements-on-one-line-colon/ Signed-off-by: Pieter De Gendt <[email protected]>
Make the "not is" more readable. See https://docs.astral.sh/ruff/rules/not-is-test/ Signed-off-by: Pieter De Gendt <[email protected]>
…541) Constant strings should not be f-strings. See https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/ 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 contextlib to suppress an error. See https://docs.astral.sh/ruff/rules/suppressible-exception/ Signed-off-by: Pieter De Gendt <[email protected]>
Convert for loop to use any(). See https://docs.astral.sh/ruff/rules/reimplemented-builtin/ Signed-off-by: Pieter De Gendt <[email protected]>
Simplify if statements with same arms. See https://docs.astral.sh/ruff/rules/if-with-same-arms/ Signed-off-by: Pieter De Gendt <[email protected]>
Simplify super() calls. See https://docs.astral.sh/ruff/rules/super-call-with-parameters/ Signed-off-by: Pieter De Gendt <[email protected]>
Do not use mutable default arguments. See https://docs.astral.sh/ruff/rules/mutable-argument-default/ Signed-off-by: Pieter De Gendt <[email protected]>
Catch explicit exceptions and pass them them to the ValueError See https://docs.astral.sh/ruff/rules/bare-except/ https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/ Signed-off-by: Pieter De Gendt <[email protected]>
Pass exceptions up the chain. See https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/ 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 Optional types with the | operator. https://docs.astral.sh/ruff/rules/non-pep604-annotation/ Signed-off-by: Pieter De Gendt <[email protected]>
…UP035) Remove some imports that are no longer needed. See https://docs.astral.sh/ruff/rules/unused-import/ https://docs.astral.sh/ruff/rules/deprecated-import/ Signed-off-by: Pieter De Gendt <[email protected]>
Apply sorting and formatting rules on imports. See https://docs.astral.sh/ruff/rules/unsorted-imports/ 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]>
Wrap long lines to max 100 characters. See https://docs.astral.sh/ruff/rules/line-too-long/ 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
force-pushed
the
ruff-scripts-west_commands-runners
branch
from
November 21, 2024 13:16
e1e4401
to
bf5f923
Compare
Rebased on |
hakehuang
approved these changes
Nov 21, 2024
henrikbrixandersen
approved these changes
Nov 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very educational, thanks!
cfriedt
approved these changes
Nov 21, 2024
soburi
approved these changes
Nov 21, 2024
hakehuang
approved these changes
Nov 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: CAN
area: West
West utility
platform: GD32
GigaDevice
platform: Intel ADSP
Intel Audio platforms
platform: NXP
NXP
platform: Synopsys
Synopsys
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR applies a series of fixes to python files located under
scripts/west_commands/runners
, see the individual commits for details.