Skip to content

Commit 0c66450

Browse files
DaniBodorsjvrijn
authored andcommitted
more aggressive linting checks
1 parent ab81417 commit 0c66450

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

{{cookiecutter.directory_name}}/pyproject.toml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,19 @@ line-length = 120
104104
output-format = "concise"
105105

106106
[tool.ruff.lint]
107-
# Enable Pyflakes `E` and `F` codes by default.
108-
select = [
109-
"F", # Pyflakes
110-
"E", # pycodestyle (error)
111-
"W", # pycodestyle (warning)
112-
# "C90", # mccabe
113-
"I", # isort
114-
"D", # pydocstyle
115-
# "PL", # Pylint
116-
# "PLC", # Convention
117-
# "PLE", # Error
118-
# "PLR", # Refactor
119-
# "PLW", # Warning
107+
# Allow unused variables when underscore-prefixed.
108+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
120109

121-
]
110+
# Enable Pyflakes `E` and `F` codes by default.
111+
select = ["ALL"]
122112
ignore = [
113+
"ANN101", # Missing type annotation for `self` in method
114+
"ANN102", # Missing type annotation for `cls` in classmethod
115+
"ANN204", # Missing return type annotation for special (dunder) method
116+
"FBT", # Using boolean function arguments
117+
"TD", # TODOs
118+
"FIX002", # Resolve TODOs
119+
"B028", # No explicit `stacklevel` keyword argument found in warning
123120
# No docstrings required in the following cases
124121
"D100", # Missing module docstring
125122
"D104", # Missing public package docstring
@@ -129,11 +126,28 @@ ignore = [
129126
pydocstyle.convention = "google"
130127

131128
# Allow autofix for all enabled rules (when `--fix`) is provided.
132-
fixable = ["A", "B", "C", "D", "E", "F", "I"]
133-
unfixable = []
129+
fixable = ["ALL"]
130+
unfixable = ["F401"] # unused imports (should not disappear while editing)
131+
extend-safe-fixes = [
132+
"D415", # First line should end with a period, question mark, or exclamation point
133+
"D300", # Use triple double quotes `"""`
134+
"D200", # One-line docstring should fit on one line
135+
"TCH", # Format type checking only imports
136+
"ISC001", # Implicitly concatenated strings on a single line
137+
"EM", # Exception message variables
138+
"RUF013", # Implicit Optional
139+
"B006", # Mutable default argument
140+
]
134141

135-
# Allow unused variables when underscore-prefixed.
136-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
142+
[lint.per-file-ignores]
143+
"tests/*" = [
144+
"S101", # Use of `assert` detected
145+
"PT011", # pytest-raises-too-broad
146+
"ANN201", # Missing return type
147+
"D103", # Missing function docstring
148+
"ANN401", # Function arguments annotated with too generic `Any` type
149+
"SLF001", # Private member access
150+
]
137151

138152
[tool.ruff.lint.isort]
139153
known-first-party = ["{{ cookiecutter.package_name }}"]

0 commit comments

Comments
 (0)