ruff.toml•2.42 kB
# Ruff configuration
target-version = "py312"
line-length = 88
# Enable preview features for additional rules
preview = true
# Exclude commonly ignored directories
exclude = [
".git",
".mypy_cache",
".ruff_cache",
".venv",
"__pycache__",
"build",
"dist",
]
[lint]
select = [
"YTT",
"ANN",
"ASYNC",
"B", # flake8-bugbear
"F", # flake8
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"PIE", # flake8-pie
"T20", # flake8-tidy20
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TC", # flake8- type checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"I", # isort
"N", # flake8-naming
"PERF", # perflint
"E", # pycodestyle
"W", # warning
"DOC", # docstring
"D", # pydocstyle
"PL", # pylint
"PLR", # pylint-robustness
"PLW", # pylint-warning
"UP", # pyupgrade
"FURB", #refurb
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line-too-long (handled by formatter)
"TRY003", # Avoid specifying long messages in exception class
"S101", # Use of assert detected (fine for tests)
"COM812", # Missing trailing comma (handled by formatter)
"PLR2004", # Magic value used in comparison
"D203", # 1 blank line required before class docstring (conflicts with D211)
"D213", # Multi-line docstring summary should start at the second line (conflicts with D212)
]
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert used
"ARG", # Unused function args
"FBT", # Don't care about booleans in tests
"PLR2004", # Magic value used in comparison
"S311", # Standard pseudo-random generators
"SLF001", # Private member accessed
"PLR0913", # Too many arguments
"PLR0915", # Too many statements
]
"scripts/**/*.py" = [
"PLR0913", # Too many arguments
]
[lint.isort]
known-first-party = ["app"]
combine-as-imports = true
force-sort-within-sections = true
[lint.flake8-tidy-imports]
ban-relative-imports = "all"
[lint.pylint]
max-args = 6
max-branches = 12
max-returns = 6
max-statements = 50
[lint.mccabe]
max-complexity = 10
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"