-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.ruff.toml
More file actions
137 lines (127 loc) · 4.56 KB
/
.ruff.toml
File metadata and controls
137 lines (127 loc) · 4.56 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
target-version = "py310"
fix = true
show-fixes = true
line-length = 120
exclude = [
"__pycache__",
".git",
".mypy_cache",
".mypy_cache",
".pytest_cache",
".ruff_cache",
".vscode",
"tests/resources",
]
[lint]
select = [
# Entire rule-sets
"A", # flake8-builtins
"F", # PyFlakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"D", # PyDocStyle
"ASYNC", # flake8-async
"FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"T20", # flake8-print
"RET", # flake8-return
"ERA", # flake8-eradicate
"PL", # Pylint
"TRY", # tryceratops
"RUF", # ruff-specific-rules
"N", # PEP8 naming
"UP", # PyUpgrade
"S", # flake8-bandit
"BLE", # flake8-blind-except
"Q", # flake8-quotes
"RSE", # flake8-raise
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"INT", # flake8-gettext
"PGH", # flake8-pygrep-hooks
"FLY", # flynt
"PERF", # perflint
"LOG", # flake8-logging
# Explicitly selected rules
"COM818", # trailing comma on bare tuple prohibited
"G010", # logging statement uses `warn` instead of `warning`
"G101", # logging statement uses an `extra` field that clashes with LogRecord
"G201", # `logging.exception` should be used instead of `logging.error(..., exc_info=True)`
"G202", # logging statement has redundant `exc_info`
"C408", # unnecessary dict call - rewrite as a literal
"D212", # multi-line docstring summary should start at the first line
"N806", # variable in function should be lowercase
"PLR09", # too-many-*; unwanted code complexity checks
"PLR2004", # magic value used in comparison, consider replacing {value} with a constant variable
"PLW0602", # `global` for variable but no assignment
"RET505", # unnecessary else/elif after return statement
"S101", # use of assert detected
"S307", # usage of builtin `eval()`
"S311", # cryptographic usage of `random` module
"S603", # subprocess call - check for execution of untrusted input
"SIM105", # prefer `contextlib.suppress` over `try/except/pass`
]
ignore = [
"D1", # undocumented-*
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D213", # multi-line docstring summary should start at the first line
"E731", # do not assign a lambda expression, use a def
"FBT001", # boolean-typed positional argument in function definition
"FBT002", # boolean default positional argument in function definition
"N812", # lowercase imported as non lowercase
"PERF203", # try-except within a for loop incurs performance overhead
"RUF012", # mutable class attributes should be annotated with typing.ClassVar
"S404", # usage of `subprocess` module
"S608", # possible SQL injection vector through string-based query construction
"TRY003", # long message in exception call
"TRY301", # raise within try - abstract raise to an inner function
"TRY400", # use `logging.exception` instead of `logging.error`
# Ruff format incompatible/overlaps
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"E501", # line-too-long
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"W191", # tab-indentation
]
[lint.per-file-ignores]
"**/__init__.py" = [
"F401", # ignore unused imports
"F403", # ignore * imports
"I001", # ignore unsorted imports
]
[lint.pydocstyle]
convention = "pep257"
[lint.isort]
lines-after-imports = 2
combine-as-imports = true
section-order = [
"future",
"standard-library",
"third-party",
"odev",
"odev-plugins",
"first-party",
"local-folder",
]
[lint.isort.sections]
"odev" = ["odev"]
"odev-plugins" = ["odev.plugins"]
[lint.mccabe]
max-complexity = 8
[format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
docstring-code-line-length = 120
line-ending = "lf"