|
| 1 | +# Ruff configuration |
| 2 | +# Modern and fast Python linter |
| 3 | + |
| 4 | +# Line length |
| 5 | +line-length = 79 |
| 6 | + |
| 7 | +# Target Python version |
| 8 | +target-version = "py312" |
| 9 | + |
| 10 | +# Exclude patterns |
| 11 | +exclude = [ |
| 12 | + ".git", |
| 13 | + "__pycache__", |
| 14 | + ".venv", |
| 15 | + "venv", |
| 16 | + "build", |
| 17 | + "dist", |
| 18 | + "migrations", |
| 19 | + "alembic", |
| 20 | + "*.egg-info", |
| 21 | +] |
| 22 | + |
| 23 | +# Lint configuration |
| 24 | +[lint] |
| 25 | +# Enable specific rule sets |
| 26 | +select = [ |
| 27 | + "E", # pycodestyle errors |
| 28 | + "W", # pycodestyle warnings |
| 29 | + "F", # pyflakes |
| 30 | + "I", # isort |
| 31 | + "B", # flake8-bugbear |
| 32 | + "C4", # flake8-comprehensions |
| 33 | + "UP", # pyupgrade |
| 34 | + "ARG", # flake8-unused-arguments |
| 35 | + "SIM", # flake8-simplify |
| 36 | +] |
| 37 | + |
| 38 | +# Ignore specific rules |
| 39 | +ignore = [ |
| 40 | + "E501", # Line too long (handled by formatter) |
| 41 | + "B008", # Do not perform function calls in argument defaults |
| 42 | + "E203", # Whitespace before ':' (flake8 compatibility - handled separately) |
| 43 | + "B027", # Empty method in ABC without abstractmethod (intentional in base providers) |
| 44 | + "ARG001", # Unused function argument (intentional in interface implementations) |
| 45 | + "ARG002", # Unused method argument (intentional in *args/**kwargs constructors and providers) |
| 46 | + "UP007", # Use X | Y for unions — incompatible with Pydantic v2 on Python 3.9 |
| 47 | +] |
| 48 | + |
| 49 | +# Allowed configurations for specific rules |
| 50 | +[lint.per-file-ignores] |
| 51 | +"__init__.py" = ["F401"] # Allow unused imports in __init__.py |
| 52 | +"tests/**" = ["ARG001", "S101"] # Allow unused arguments and assert in tests |
| 53 | + |
| 54 | +# Import sorting (isort) |
| 55 | +[lint.isort] |
| 56 | +known-first-party = ["dotflow"] |
| 57 | +force-single-line = false |
| 58 | + |
| 59 | +# Formatting (alternative to black) |
| 60 | +[format] |
| 61 | +quote-style = "double" |
| 62 | +indent-style = "space" |
| 63 | +skip-magic-trailing-comma = false |
0 commit comments