-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.ruff.toml
More file actions
40 lines (36 loc) · 1.58 KB
/
Copy path.ruff.toml
File metadata and controls
40 lines (36 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 The Linux Foundation
# Pin the ruff rule set explicitly.
#
# Without a `select`, ruff applies its *default* rule set, and that
# default is not stable across releases:
#
# ruff 0.15.22 -> 59 rules across 2 categories (E, F)
# ruff 0.16.0 -> 413 rules across 38 categories
#
# A routine pre-commit autoupdate crossing that boundary changed which
# rules run and broke fifteen repositories in this organisation at once,
# on code nobody had touched.
#
# Pinning does not decline the unselected rules. It makes adopting them
# a deliberate, reviewed change instead of a side effect of a version
# bump.
#
# `line-length` and `target-version` are intentionally left unset so
# ruff's own defaults continue to apply unchanged.
[lint]
# The de-facto standard across this organisation: present as a superset
# in 13 of the 16 repositories that already pin their rules.
select = ["E", "W", "F", "I", "B", "C4", "UP"]
ignore = [
"E501", # line-too-long: the formatter owns line length
"B008", # function call in argument default: typer/click idiom
]
[lint.per-file-ignores]
# Test suites legitimately break rules that matter in library code.
# Listed even where not currently selected, so that widening `select`
# later does not immediately flag every test module. PLR0917 in
# particular cannot be satisfied by tests that stack `@patch`
# decorators: unittest.mock injects its mocks positionally, so a
# keyword-only signature is impossible, not merely inconvenient.
"tests/**/*.py" = ["S101", "ARG", "PLR0913", "PLR0917", "PLR2004"]