-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
62 lines (52 loc) · 1.91 KB
/
ruff.toml
File metadata and controls
62 lines (52 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Ruff configuration
# Docs: https://docs.astral.sh/ruff/
# Same as Black
line-length = 120
indent-width = 4
# Assume Python 3.13
target-version = "py313"
[lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
# Unlike Flake8, default to a restricted set of rules rather than all rules.
# Add additional rule sets as needed.
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
"N", # pep8-naming
"C90", # mccabe
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"W191", # indentation contains tabs
"N802", # Function name should be lowercase (allow _YYYY_MM_to_unixtime_range)
"SIM115", # Use context manager for opening files (complex cases)
"SIM117", # Use single with statement (readability preference)
"E402", # Module level import not at top (test fixtures)
"B904", # Within except clause, raise from err (legacy compatibility)
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[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"
[lint.per-file-ignores]
"tests/*" = ["S101"] # Allow assert statements in tests
"conftest.py" = ["F401"] # Allow unused imports in conftest.py
"app/routes/notifications.py" = ["E712"] # Peewee ORM uses == False for SQL WHERE clauses