-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathruff.toml
161 lines (126 loc) · 3.52 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
target-version = "py37"
line-length = 80
[lint]
select = [
"A",
"ARG",
"B",
# "BLE",
"C",
"C4",
# "C90" mccabe
# Not clear if this check is useful. Too many commas everywhere.
# "COM",
"D",
# "DTZ",
# "E",
"EXE",
"ERA",
"F",
# "FBT",
"G",
"I",
"ISC",
"ICN",
# "N",
"PGH",
# "PIE",
"PL", # Pylint
# "PT", # pytest
# "PTH",
"Q", # Quotes
# "RET",
# "RUF",
# "S",
# "SIM",
# "SLF",
"T20",
# "TCH",
# "TRY",
"UP",
"W",
"YTT",
]
ignore = [
# TBD: Unnecessary `list` comprehension (rewrite using `list()`)
"C416",
# TBD: Unnecessary `map` usage (rewrite using a `list` comprehension)
"C417",
# X is too complex
"C901",
# FIXME: Would be great to enable these at some point.
# Missing docstring in public module
"D100",
# Missing docstring in public class
"D101",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in public nested class
"D106",
# Missing docstring in `__init__`
"D107",
# One-line docstring should fit on one line
"D200",
# No blank lines allowed after function docstring (found {num_lines})
"D202",
# 1 blank line required before class docstring
"D203",
# FIXME: 1 blank line required between summary line and description
"D205",
# Multi-line docstring summary should start at the first line
"D212",
# FIXME: This is nice to enable but some test fixtures will need to be fixed.
# First line should end with a period
"D400",
# FIXME: First line of docstring should be in imperative mood: "Some text."
"D401",
# FIXME: Enable at some point: First word of the docstring should not be "This"
"D404",
# No blank lines allowed between a section header and its content
"D412",
# Missing blank line after last section ("Examples")
"D413",
# FIXME: This is nice to enable but some test fixtures will need to be fixed.
# First line should end with a period, question mark, or exclamation point
"D415",
# Line length violations. This is handled by Ruff format.
"E501",
# A warning by ruff format:
# warning: The following rules may cause conflicts when used with the formatter: `ISC001`.
"ISC001",
# PGH004 Use specific rule codes when using ruff: noqa
"PGH004",
# Too many return statements
"PLR0911",
# Too many branches
"PLR0912",
# Too many arguments in function definition
"PLR0913",
# Too many statements
"PLR0915",
# FIXME: Enable: Use `sys.exit()` instead of `exit`
"PLR1722",
# Magic value used in comparison
"PLR2004",
# Use `elif` instead of `else` then `if`, to reduce indentation
"PLR5501",
"UP035", # [*] Import from `collections.abc` instead: `Iterator`
"UP038", # [*] Use `X | Y` in `isinstance` call instead of `(X, Y)` (conflict with Pylint)
]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
# Skip non UTF-8 test files
exclude = ["tests/**/invalid_file*"]
# B008 Do not perform function calls in argument defaults.
# The call is performed only once at function definition time.
[lint.per-file-ignores]
"strictdoc/server/routers/main_router.py" = ["B008"]
# Some of our helpers have deliberatly the name of a standard library module
[lint.flake8-builtins]
builtins-allowed-modules = ["math", "pickle", "string"]