Install the dependency
pip install ruff
Foramt files
ruff format .
ruff check --fix
Check errors
ruff check .
[tool.ruff.lint]
select = [
"S", # flake8-bandit
"B", # flake8-bugbear
"C", # flake8-comprehensions
"SIM", # flake8-simplify
"I", # isort
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"D", # pydocstyle
"UP", # pyupgrade
"RUF100", # Unused noqa directive
]
[tool.ruff]
line-length = 120
target-version = "py312"
ignore = ["B904", "E501", "S101", "D1", "D212"]
[tool.ruff.lint.per-file-ignores]
"tests/test_*.py" = [
"S",
]
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py files
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
[tool.ruff.lint.isort]
combine-as-imports=true
split-on-trailing-comma=true
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
force-wrap-aliases=true
[tool.ruff.lint.isort.sections]
django = ["django"]
[tool.ruff.lint.pydocstyle]
convention = "google"