Skip to content

boot-utils: Enable EM rule set and preview mode for ruff#133

Merged
msfjarvis merged 8 commits intoClangBuiltLinux:mainfrom
nathanchance:ruff-toml-updates-2026-4-16
Apr 16, 2026
Merged

boot-utils: Enable EM rule set and preview mode for ruff#133
msfjarvis merged 8 commits intoClangBuiltLinux:mainfrom
nathanchance:ruff-toml-updates-2026-4-16

Conversation

@nathanchance
Copy link
Copy Markdown
Member

See the individual changes for the full details.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
To catch any changes to ruff's default rule set.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
While this is a little more verbose, it should result in easier to read
exceptions since the exception message won't be printed twice in the
stacktrace. This also allows us to drop disabling TRY003.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  error[PLR6201]: Use a set literal when testing for membership
     --> utils.py:129:19
      |
  127 |     # If the image is an uncompressed vmlinux or a UML image, it is in the
  128 |     # root of the build folder
  129 |     elif image in ("vmlinux", "linux"):
      |                   ^^^^^^^^^^^^^^^^^^^^
  130 |         kernel = kernel_location.joinpath(image)
  131 |     # Otherwise, it is in the architecture's boot directory
      |
  help: Convert to `set`

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  error[PLR6301]: Method `_have_dev_kvm_access` could be a function, class method, or static method
     --> boot-qemu.py:174:9
      |
  172 |         return tuple(int(x) for x in match.groups()[0].split('.'))
  173 |
  174 |     def _have_dev_kvm_access(self) -> bool:
      |         ^^^^^^^^^^^^^^^^^^^^
  175 |         return os.access('/dev/kvm', os.R_OK | os.W_OK)
      |
  help: Consider adding `@typing.override` if this method overrides a method from a superclass

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
To gain access to some experimental warnings that are still useful.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@msfjarvis
Copy link
Copy Markdown
Member

pylint seems to disagree with flake8-errmsg

  ************* Module boot-qemu
  boot-qemu.py:85:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:104:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:133:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:160:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:170:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:182:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:264:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:280:12: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  boot-qemu.py:737:8: W0621: Redefining name 'msg' from outer scope (line 865) (redefined-outer-name)
  ************* Module rebuild
  buildroot/rebuild.py:67:12: W0621: Redefining name 'msg' from outer scope (line 175) (redefined-outer-name)
  buildroot/rebuild.py:116:16: W0621: Redefining name 'msg' from outer scope (line 175) (redefined-outer-name)
  buildroot/rebuild.py:122:8: W0621: Redefining name 'msg' from outer scope (line 175) (redefined-outer-name)
  buildroot/rebuild.py:175:8: C0103: Constant name "msg" doesn't conform to UPPER_CASE naming style (invalid-name)

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Copy Markdown
Member Author

pylint seems to disagree with flake8-errmsg

Thanks. I pushed a quick fix. I think we can probably drop pylint soon, given ruff / ty have fairly good feature parity at this point.

@msfjarvis msfjarvis merged commit c022cb8 into ClangBuiltLinux:main Apr 16, 2026
6 checks passed
@nathanchance nathanchance deleted the ruff-toml-updates-2026-4-16 branch April 16, 2026 20:44
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