nathanchance · GitHub

This is an opinionated set of warnings from the full list that ruff
supports.
Link: https://beta.ruff.rs/docs/rules/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
We will be switching to ruff for quick linting, so remove the flake8
annotations to clear up:
  boot-uml.py:26:16: RUF100 [*] Unused `noqa` directive (unknown: `E251`)
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Clears up ruff warning:
  boot-qemu.py:211:14: PTH123 `open("foo")` should be replaced by `Path("foo").open()`
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Clears up ruff warnings:
  boot-qemu.py:636:9: SIM108 [*] Use ternary operator `qemu = "qemu-system-i386" if arch == "x86" else "qemu-system-x86_64"` instead of if-else-block
  boot-qemu.py:651:9: SIM108 Use ternary operator `dtb_dir = "dts" if "boot" in str(kernel) else "dtbs"` instead of if-else-block
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Clears up ruff warning:
  boot-qemu.py:700:23: RUF005 [*] Consider `[qemu, *qemu_args]` instead of concatenation
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
As suggested by ruff:
  boot-qemu.py:792:21: SIM105 Use `contextlib.suppress(KeyboardInterrupt)` instead of try-except-pass
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

@nathanchance

msfjarvis

@nathanchance

@nathanchance

Read the original on github.com ↗