Skip to content

Commit e62e576

Browse files
committed
Enable ISC, SLF Ruff rule sets and fix ambiguous character rules
1 parent 89e85e1 commit e62e576

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

pyproject.toml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,16 @@ source = ["src/tmlt/core", ".nox/**/site-packages/tmlt/core"]
194194
# Linter configuration
195195

196196
[tool.ruff.lint]
197-
# Enable Ruff-specific lints plus Pylint, pydocstyle, pyflakes, and pycodestyle.
198-
# The latter two cover many lints that we previously used pylint for, but
199-
# because they are overlapping Ruff only implements them in one set of rules.
200-
select = ["RUF", "PL", "D", "F", "E", "W"]
197+
# A list of all of Ruff's rules can be found at https://docs.astral.sh/ruff/rules/
198+
select = [
199+
# Enable Ruff-specific lints plus Pylint, pydocstyle, pyflakes, and pycodestyle.
200+
# The latter two cover many lints that we previously used pylint for, but
201+
# because they are overlapping Ruff only implements them in one set of rules.
202+
"RUF", "PL", "D", "F", "E", "W",
203+
# Also enable a subset of flake8 rules, for similar reasons to pyflakes/pycodestyle.
204+
"ISC", "SLF"
205+
]
201206
ignore = [
202-
"RUF002", # ambiguous-unicode-character-docstring -- doesn't like unicode Greek letters
203207
"PLR09", # too-many-*
204208
"PLR2004", # magic-value-comparison
205209

@@ -213,7 +217,7 @@ ignore = [
213217
"PLW0177", # nan-comparison
214218
"RUF005", # collection-literal-concatenation
215219
"PLR1730", # if-stmt-min-max
216-
"PLW0127", # selt-assigning-variable
220+
"PLW0127", # self-assigning-variable
217221
"PLW0128", # redeclared-assigned-name
218222
"RUF015", # unnecessary-iterable-allocation-for-first-element
219223
"D417", # undocumented-param
@@ -227,8 +231,16 @@ ignore = [
227231
"E501", # line-too-long
228232
"E731", # lambda-assignment
229233
"E741", # ambiguous-variable-name
234+
"SLF001", # private-member-access
235+
"RET504", # unnecessary-assign
230236
]
231237

238+
# Ruff's RUF001-003 rules disallow certain Unicode characters that are easily
239+
# confused with ASCII characters; this makes sense for the most part, but some
240+
# of our docstrings use Greek letters that fall into that category. This allows
241+
# those characters.
242+
allowed-confusables = ['α', 'ρ', '𝝆']
243+
232244
[tool.ruff.lint.pydocstyle]
233245
convention = "google"
234246

0 commit comments

Comments
 (0)