Skip to content

Commit 9451420

Browse files
committed
update ruff check test: specify 'check' command and further ignores
1 parent 1360ccf commit 9451420

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def test_ruff_check(baked_with_development_dependencies, project_env_bin_dir):
167167
project_dir = baked_with_development_dependencies
168168
bin_dir = project_env_bin_dir
169169

170-
result = run([f'{bin_dir}ruff', '.'], project_dir)
170+
result = run([f'{bin_dir}ruff', 'check', '--fix'], project_dir)
171171
assert result.returncode == 0
172172
assert '' in result.stdout
173173

{{cookiecutter.directory_name}}/pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ ignore = [
115115
"ANN204", # Missing return type annotation for special (dunder) method
116116
"FBT", # Using boolean function arguments
117117
"TD", # TODOs
118+
"FIX001", # Resolve FIXMEs
118119
"FIX002", # Resolve TODOs
119120
"B028", # No explicit `stacklevel` keyword argument found in warning
120121
# No docstrings required in the following cases
@@ -139,15 +140,21 @@ extend-safe-fixes = [
139140
"B006", # Mutable default argument
140141
]
141142

142-
[lint.per-file-ignores]
143+
[tool.ruff.lint.per-file-ignores]
143144
"tests/*" = [
144145
"S101", # Use of `assert` detected
145146
"PT011", # pytest-raises-too-broad
147+
"ANN001", # Missing function argument type
146148
"ANN201", # Missing return type
147149
"D103", # Missing function docstring
148150
"ANN401", # Function arguments annotated with too generic `Any` type
149151
"SLF001", # Private member access
150152
]
153+
"docs/conf.py" = [
154+
"INP001", # Add __init__.py to implicit namespace package
155+
"ERA001", # Commented-out code
156+
"A001", # Shadowing Python builtin name, specifically `copyright`
157+
]
151158

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

{{cookiecutter.directory_name}}/src/{{cookiecutter.package_name}}/my_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
# FIXME: put actual code here
5-
def hello(name):
5+
def hello(name: str) -> str:
66
"""Say hello.
77
88
Function docstring using Google docstring style.

0 commit comments

Comments
 (0)