@@ -160,13 +160,10 @@ pyzmq = "^25"
160160
161161[tool .poetry .dev-dependencies ]
162162pytest = " ^7.2.1"
163- flake8 = " ~4.0.1 "
163+ ruff = " ^0 "
164164mypy = " ^1.1.1"
165- isort = " ^5.11.4"
166165pre-commit = " ^3.0.1"
167- wemake-python-styleguide = " ^0.17.0"
168166black = " ^22.12.0"
169- autoflake = " ^1.6.1"
170167pytest-cov = " ^4.0.0"
171168anyio = " ^3.6.2"
172169pytest-env = " ^0.8.1"
@@ -247,6 +244,74 @@ src_folder = "./{{cookiecutter.project_name}}"
247244{%- endif %}
248245{%- endif %}
249246
247+ [tool .ruff ]
248+ # List of enabled rulsets.
249+ # See https://docs.astral.sh/ruff/rules/ for more information.
250+ lint.select = [
251+ " E" , # Error
252+ " F" , # Pyflakes
253+ " W" , # Pycodestyle
254+ " C90" , # McCabe complexity
255+ " I" , # Isort
256+ " N" , # pep8-naming
257+ " D" , # Pydocstyle
258+ " ANN" , # Pytype annotations
259+ " S" , # Bandit
260+ " B" , # Bugbear
261+ " COM" , # Commas
262+ " C4" , # Comprehensions
263+ " ISC" , # Implicit string concat
264+ " PIE" , # Unnecessary code
265+ " T20" , # Catch prints
266+ " PYI" , # validate pyi files
267+ " Q" , # Checks for quotes
268+ " RSE" , # Checks raise statements
269+ " RET" , # Checks return statements
270+ " SLF" , # Self checks
271+ " SIM" , # Simplificator
272+ " PTH" , # Pathlib checks
273+ " ERA" , # Checks for commented out code
274+ " PL" , # PyLint checks
275+ " RUF" , # Specific to Ruff checks
276+ ]
277+ lint.ignore = [
278+ " D105" , # Missing docstring in magic method
279+ " D107" , # Missing docstring in __init__
280+ " B008" , # Do not perform function calls in argument defaults
281+ " D211" , # No blank lines allowed before class docstring
282+ " D212" , # Multi-line docstring summary should start at the first line
283+ " D401" , # First line should be in imperative mood
284+ " D104" , # Missing docstring in public package
285+ " D100" , # Missing docstring in public module
286+ " D202" , # No blank lines allowed after function docstring
287+ " ANN102" , # Missing type annotation for self in method
288+ " ANN101" , # Missing type annotation for argument
289+ " ANN401" , # typing.Any are disallowed in `**kwargs
290+ " PLR0913" , # Too many arguments for function call
291+ " D106" , # Missing docstring in public nested class
292+ ]
293+ exclude = [
294+ {%- if cookiecutter.orm in ["ormar", "sqlalchemy", "piccolo", "tortoise"] %}
295+ "{{ cookiecutter.project_name }}/db/migrations",
296+ {%- endif %}
297+ ".venv/"
298+ ]
299+ lint.mccabe = { max-complexity = 10 }
300+ line-length = 88
301+
302+ [tool .ruff .lint .per-file-ignores ]
303+ "tests/*" = [
304+ " S101" , # Use of assert detected
305+ ]
306+
307+ [tool .ruff .lint .pydocstyle ]
308+ convention = " pep257"
309+ ignore-decorators = [" typing.overload" ]
310+
311+ [tool .ruff .lint .pylint ]
312+ allow-magic-value-types = [" int" , " str" , " float" , " bytes" ]
313+
314+
250315[fastapi-template .options ]
251316{%- for key, value in cookiecutter.items() %}
252317{%- if not key.startswith("_") and not key == "db_info" %}
0 commit comments