# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "C", # mccabe "B", # flake8-bugbear "Q", # flake8-quotes "DJ", # flake8-django ] extend-ignore = [ "E501", # line too long, handled by formatter "DJ01", # Missing docstring (too strict for Django) "DJ001", # null=True on string fields (architectural decision) "F403", # star imports (common in Django settings) "F405", # name may be undefined from star imports (Django settings) "E402", # module level import not at top (Django settings) ] # Allow autofix for all enabled rules (when `--fix`) is provided. fixable = ["ALL"] unfixable = [] # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg", ".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv", "*/migrations/*", "*/__pycache__/*", ] # Same as Black. line-length = 88 # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # Assume Python 3.11. target-version = "py311" [mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 [per-file-ignores] # Ignore `E402` (import violations) in all `__init__.py` files "__init__.py" = ["E402"] # Ignore star imports and related errors in settings "src/config/settings/*" = ["F403", "F405", "E402"] # Ignore star imports in test runner files "check_tests.py" = ["F403"] "run_tests.py" = ["F403"] # Ignore complexity issues in tests "tests/*" = ["C901"] "**/test_*" = ["C901"] "**/tests.py" = ["C901"] [format] # Like Black, use double quotes for strings. quote-style = "double" # Like Black, indent with spaces, rather than tabs. indent-style = "space" # Like Black, respect magic trailing commas. skip-magic-trailing-comma = false # Like Black, automatically detect the appropriate line ending. line-ending = "auto"