Skip to content

Instantly share code, notes, and snippets.

@oliverandrich
Last active March 12, 2023 19:55
Show Gist options
  • Save oliverandrich/a7219b1c9a09d557df17e50f183f1c26 to your computer and use it in GitHub Desktop.
Save oliverandrich/a7219b1c9a09d557df17e50f183f1c26 to your computer and use it in GitHub Desktop.
My current ruff configuration in Django projects. https://beta.ruff.rs/docs/
[tool.ruff]
select = ["A", "B", "C4", "E", "F", "I", "DJ", "INP", "TID", "UP", "YTT"]
ignore = []
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C4", "E", "F", "I", "TID", "UP"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".github",
".hg",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"build",
"dist",
"migrations",
"node_modules",
"static",
]
# Same as Black.
line-length = 100
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.10.
target-version = "py311"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment