Skip to content

Commit b8b0dd8

Browse files
committed
chore(ruff): turn on more ruff checkers
Based on Unblob's ruleset[^1]. I've removed a few which don't make sense here: - flake8-boolean-trap -> many small CLI functions use bool flags - flake8-logging-format -> don't use logging - flake8-tidy-imports -> we don't have imports to ban
1 parent 836fd0e commit b8b0dd8

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,52 @@ dev = ["ruff==0.14.10"]
3838
[build-system]
3939
requires = ["hatchling"]
4040
build-backend = "hatchling.build"
41+
42+
[tool.ruff]
43+
target-version = "py310"
44+
45+
[tool.ruff.lint]
46+
select = [
47+
"A", # flake8-builtins
48+
"ARG", # flake8-unused-arguments
49+
"B", # flake8-bugbear
50+
"C4", # flake8-comprehensions
51+
"C90", # mccabe
52+
"COM818", # flake8-commas; trailing-comma-on-bare-tuple
53+
"D", # pydocstyle
54+
"E", # pycodestyle (errors)
55+
"F", # pyflakes
56+
"I", # isort
57+
"N", # pep8-naming
58+
"PIE", # flake8-pie
59+
"PL", # pylint
60+
"PT", # flake8-pytest-style
61+
"PTH", # flake8-use-pathlib
62+
"RET", # flake8-return
63+
"RSE", # flake8-raise
64+
"RUF", # ruff's own lints
65+
"S", # flake8-bandit
66+
"SIM", # flake8-simplify
67+
"SLF", # flake8-self
68+
"T10", # flake8-debugger
69+
"T20", # flake8-print
70+
"TC", # flake8-type-checking
71+
"TRY", # tryceratops
72+
"UP", # pyupgrade
73+
"W", # pycodestyle (warnings)
74+
]
75+
76+
ignore = [
77+
"D1", # undocumented-*: We are not documenting every public symbol
78+
"D203", # one-blank-line-before-class: D211 (no-blank-line-before-class) is used instead
79+
"D213", # multi-line-summary-second-line: D212 (multi-line-summary-first-line) is used instead
80+
"E501", # line-too-long: Let ruff format handle line length violations
81+
"N818", # error-suffix-on-exception-name: Exception names can be meaningful without smurfs
82+
"PLR09", # too-many-{arguments,branches,...}: We do not want to impose hard limits
83+
"S101", # assert: Enable usage of asserts
84+
]
85+
86+
[tool.ruff.lint.per-file-ignores]
87+
"examples/*" = [
88+
"T201", # print
89+
]

0 commit comments

Comments
 (0)