selftests: net: add ruff linter exclusions
Subsystems (3)
Jakub Kicinski
maintainerPATCH v2 1/1 selftests: net: add ruff linter exclusions
Fedora is now shipping ruff 0.16 which added a ton of more opinionated rules. Let's add some exclusions for checks which are both noisy and IMO of questionable value. We can still follow them for new code but it's a matter of preference.
C401: set(x for x in Y) -> {x for x in Y}
I find the set() a little more readable.
I001: hard requirements to sort includes
A little too much
RUF015: list(set_a - set_b)[0] -> next(iter(set_a - set_b))
list + index are more readable to a "C person" for sure.
---
v2:
- drop the . in front of the file name
v1: https://lore.kernel.org/[email protected]
--- tools/testing/selftests/drivers/net/ruff.toml | 4 ++++ tools/testing/selftests/net/ruff.toml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 tools/testing/selftests/drivers/net/ruff.toml create mode 100644 tools/testing/selftests/net/ruff.toml
tools/testing/selftests/drivers/net/ruff.toml new file +4 -0
@@ -0,0 +1,4 @@ +# NOTE: keep in sync between .../net/ and .../drivers/net/ + +[lint] +ignore = ["C401", "I001", "RUF015"]
tools/testing/selftests/net/ruff.toml new file +4 -0
@@ -0,0 +1,4 @@ +# NOTE: keep in sync between .../net/ and .../drivers/net/ + +[lint] +ignore = ["C401", "I001", "RUF015"]
Signature · 1 line
2.55.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Sat, 12 Sep 2026 16:39:26 -0700 you wrote:
Fedora is now shipping ruff 0.16 which added a ton of more opinionated rules. Let's add some exclusions for checks which are both noisy and IMO of questionable value. We can still follow them for new code but it's a matter of preference.
C401: set(x for x in Y) -> {x for x in Y}
[...]
Here is the summary with links:
- [net-next,v2] selftests: net: add ruff linter exclusions
https://git.kernel.org/netdev/net-next/c/7b37f1109039
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html