Skip to content

Commit 5016ed3

Browse files
BordaCopilot
andauthored
chore(pre_commit): update Ruff rules with its references (#2040)
The `fixanle` they do not have any impact if they are not listed in selected. In Ruff, the select list determines which rules are active (checked). The fixable list merely controls which of those active rules are allowed to automatically modify your code when running with --fix. If a rule is listed in fixable but not in select, it is effectively disabled; Ruff won't look for it, so there will be no errors to fix. Listing extra items in fixable is harmless but redundant code clutter. The default value for fixable in Ruff is ["ALL"]. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d570366 commit 5016ed3

File tree

1 file changed

+12
-49
lines changed

1 file changed

+12
-49
lines changed

pyproject.toml

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -124,56 +124,19 @@ line-length = 88
124124
indent-width = 4
125125

126126
[tool.ruff.lint]
127-
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
128-
select = ["E", "F", "I", "A", "Q", "W", "RUF", "UP", "S"]
129-
ignore = []
130-
# Allow autofix for all enabled rules (when `--fix`) is provided.
131-
fixable = [
132-
"A",
133-
"B",
134-
"C",
135-
"D",
136-
"E",
137-
"F",
138-
"G",
139-
"I",
140-
"N",
141-
"Q",
142-
"S",
143-
"T",
144-
"W",
145-
"ANN",
146-
"ARG",
147-
"BLE",
148-
"COM",
149-
"DJ",
150-
"DTZ",
151-
"EM",
152-
"ERA",
153-
"EXE",
154-
"FBT",
155-
"ICN",
156-
"INP",
157-
"ISC",
158-
"NPY",
159-
"PD",
160-
"PGH",
161-
"PIE",
162-
"PL",
163-
"PT",
164-
"PTH",
165-
"PYI",
166-
"RET",
167-
"RSE",
168-
"RUF",
169-
"SIM",
170-
"SLF",
171-
"TCH",
172-
"TID",
173-
"TRY",
174-
"UP",
175-
"YTT",
127+
# Enable linting rules for code style, imports, and best practices.
128+
select = [
129+
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
130+
"F", # Pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
131+
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
132+
"A", # flake8-builtins - https://docs.astral.sh/ruff/rules/#flake8-builtins-a
133+
"Q", # flake8-quotes - https://docs.astral.sh/ruff/rules/#flake8-quotes-q
134+
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#pycodestyle-w
135+
"RUF", # Ruff-specific rules - https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
136+
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
137+
"S", # bandit - https://docs.astral.sh/ruff/rules/#flake8-bandit-s
176138
]
139+
ignore = []
177140
unfixable = []
178141
# Allow unused variables when underscore-prefixed.
179142
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

0 commit comments

Comments
 (0)