boot-utils: Enable and fix several Ruff rules#132
Merged
msfjarvis merged 8 commits intoClangBuiltLinux:mainfrom Apr 13, 2026
Merged
boot-utils: Enable and fix several Ruff rules#132msfjarvis merged 8 commits intoClangBuiltLinux:mainfrom
msfjarvis merged 8 commits intoClangBuiltLinux:mainfrom
Conversation
This was done in tc-build but not this repo, where it actually improves readability quite a bit. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
As suggested by the refurb rules from ruff:
FURB167 [*] Use of regular expression alias `re.M`
--> boot-qemu.py:140:93
|
138 | strings_stdout = strings.stdout.decode(encoding='utf-8', errors='ignore')
139 |
140 | if not (match := re.search(r'^Linux version (\d+\.\d+\.\d+)', strings_stdout, flags=re.M)):
| ^^^^
141 | raise RuntimeError(f"Could not find Linux version in {self.kernel}?")
|
help: Replace with `re.MULTILINE`
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
As pointed out by the refurb rules in ruff.toml:
FURB171 Membership test against single-item container
--> boot-qemu.py:130:12
|
129 | utils.check_cmd(decomp_prog)
130 | if decomp_prog in ('gzip',):
| ^^^^^^^^^^^^^^^^^^^^^^^^
131 | decomp_cmd = [decomp_prog, '-c', '-d', self.kernel]
132 | else:
|
help: Convert to equality test
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
There are no instances of these currently but they all seem like relatively safe additions (even if DTZ may never get triggered since this project does not use datetime). Signed-off-by: Nathan Chancellor <nathan@kernel.org>
msfjarvis
approved these changes
Apr 13, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See the individual commits for the full details.