Thread (3 messages) flat view 3 messages, 3 authors, 12d ago

Re: [PATCH net-next] selftests: net: add ruff linter exclusions

From: Nicolai Buchwitz <nb@tipi-net.de>
Date: 2026-09-11 22:17:52
Also in: linux-kselftest


On September 11, 2026 11:34:12 PM GMT+02:00, Jakub Kicinski [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: shuah@kernel.org
CC: linux-kselftest@vger.kernel.org
---
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
diff --git a/tools/testing/selftests/drivers/net/.ruff.toml b/tools/testing/selftests/drivers/net/.ruff.toml
new file mode 100644
index 000000000000..f58d51f35317
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/.ruff.toml
@@ -0,0 +1,4 @@
+# NOTE: keep in sync between .../net/ and .../drivers/net/
+
+[lint]
+ignore = ["C401", "I001", "RUF015"]
diff --git a/tools/testing/selftests/net/.ruff.toml b/tools/testing/selftests/net/.ruff.toml
new file mode 100644
index 000000000000..f58d51f35317
--- /dev/null
+++ b/tools/testing/selftests/net/.ruff.toml
@@ -0,0 +1,4 @@
+# NOTE: keep in sync between .../net/ and .../drivers/net/
+
+[lint]
+ignore = ["C401", "I001", "RUF015"]

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help