-
Notifications
You must be signed in to change notification settings - Fork 1
/
.ruff.toml
96 lines (65 loc) · 3.14 KB
/
.ruff.toml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
indent-width = 4
line-length = 120
target-version = "py38"
src = [
"src",
"tests"
]
[lint]
select = ["ALL"]
ignore = [
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"RET501", # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
"TRY400", # https://docs.astral.sh/ruff/rules/error-instead-of-exception/
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A003", # Python builtin is shadowed by class attribute {name} from {row}
# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F401", # {name} imported but unused; consider using importlib.util.find_spec to test for availability
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP038", # Use X | Y in {} call instead of (X, Y)
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN101", # Missing type annotation for {name} in method
"ANN102", # Missing type annotation for {name} in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE001", # Do not catch blind exception: {name}
# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE102", # Unnecessary parentheses on raised exception
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing
"COM819", # Trailing comma prohibited
# https://docs.astral.sh/ruff/rules/#warning-w_1
"PLW0603", # Using the global statement to update {name} is discouraged
# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"G004", # Logging statement uses f-string
# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR1711", # Useless return statement at end of function
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF005", # Consider {expression} instead of concatenation
]
[format]
quote-style = "single"
# https://docs.astral.sh/ruff/settings/#lintflake8-quotes
[lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"
[lint.flake8-builtins]
builtins-ignorelist = ["id", "input"]
# https://docs.astral.sh/ruff/settings/#lintisort
[lint.isort]
lines-after-imports = 2 # https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports
[lint.per-file-ignores]
"setup.py" = ["PTH123"]
"tests/*" = [
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S101", # Use of assert detected
# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLR0913", # Too many arguments in function definition ({c_args} > {max_args})
]