1
- [tool .black ]
2
- line-length = 88
3
-
4
1
[tool .bumpversion ]
5
2
current_version = " 0.26.0"
6
3
commit = true
@@ -34,12 +31,6 @@ exclude_also = [
34
31
" @(abc\\ .)?abstractmethod" ,
35
32
]
36
33
37
- [tool .isort ]
38
- profile = " black"
39
- multi_line_output = 3
40
- # scrapy_poet/__init__.py: Automatic sorting causes circular dependencies.
41
- skip = [" scrapy_poet/__init__.py" ]
42
-
43
34
[[tool .mypy .overrides ]]
44
35
module = [
45
36
" tests.test_cache.*" ,
@@ -51,3 +42,154 @@ module = [
51
42
# when test cases are decorated with @inlineCallbacks. However, the
52
43
# tests doesn't return anything at all.
53
44
disable_error_code = " misc"
45
+
46
+ [tool .ruff .lint ]
47
+ extend-select = [
48
+ # flake8-builtins
49
+ " A" ,
50
+ # flake8-async
51
+ " ASYNC" ,
52
+ # flake8-bugbear
53
+ " B" ,
54
+ # flake8-comprehensions
55
+ " C4" ,
56
+ # flake8-commas
57
+ " COM" ,
58
+ # pydocstyle
59
+ " D" ,
60
+ # flake8-future-annotations
61
+ " FA" ,
62
+ # flynt
63
+ " FLY" ,
64
+ # refurb
65
+ " FURB" ,
66
+ # isort
67
+ " I" ,
68
+ # flake8-implicit-str-concat
69
+ " ISC" ,
70
+ # flake8-logging
71
+ " LOG" ,
72
+ # Perflint
73
+ " PERF" ,
74
+ # pygrep-hooks
75
+ " PGH" ,
76
+ # flake8-pie
77
+ " PIE" ,
78
+ # pylint
79
+ " PL" ,
80
+ # flake8-pytest-style
81
+ " PT" ,
82
+ # flake8-use-pathlib
83
+ " PTH" ,
84
+ # flake8-pyi
85
+ " PYI" ,
86
+ # flake8-quotes
87
+ " Q" ,
88
+ # flake8-return
89
+ " RET" ,
90
+ # flake8-raise
91
+ " RSE" ,
92
+ # Ruff-specific rules
93
+ " RUF" ,
94
+ # flake8-bandit
95
+ " S" ,
96
+ # flake8-simplify
97
+ " SIM" ,
98
+ # flake8-slots
99
+ " SLOT" ,
100
+ # flake8-debugger
101
+ " T10" ,
102
+ # flake8-type-checking
103
+ " TC" ,
104
+ # flake8-tidy-imports
105
+ " TID" ,
106
+ # pyupgrade
107
+ " UP" ,
108
+ # pycodestyle warnings
109
+ " W" ,
110
+ # flake8-2020
111
+ " YTT" ,
112
+ ]
113
+ ignore = [
114
+ # Trailing comma missing
115
+ " COM812" ,
116
+ # Missing docstring in public module
117
+ " D100" ,
118
+ # Missing docstring in public class
119
+ " D101" ,
120
+ # Missing docstring in public method
121
+ " D102" ,
122
+ # Missing docstring in public function
123
+ " D103" ,
124
+ # Missing docstring in public package
125
+ " D104" ,
126
+ # Missing docstring in magic method
127
+ " D105" ,
128
+ # Missing docstring in __init__
129
+ " D107" ,
130
+ # One-line docstring should fit on one line with quotes
131
+ " D200" ,
132
+ # No blank lines allowed after function docstring
133
+ " D202" ,
134
+ # 1 blank line required between summary line and description
135
+ " D205" ,
136
+ # Multi-line docstring closing quotes should be on a separate line
137
+ " D209" ,
138
+ # First line should end with a period
139
+ " D400" ,
140
+ # First line should be in imperative mood; try rephrasing
141
+ " D401" ,
142
+ # First line should not be the function's "signature"
143
+ " D402" ,
144
+ # Too many return statements
145
+ " PLR0911" ,
146
+ # Too many branches
147
+ " PLR0912" ,
148
+ # Too many arguments in function definition
149
+ " PLR0913" ,
150
+ # Too many statements
151
+ " PLR0915" ,
152
+ # Magic value used in comparison
153
+ " PLR2004" ,
154
+ # String contains ambiguous {}.
155
+ " RUF001" ,
156
+ # Docstring contains ambiguous {}.
157
+ " RUF002" ,
158
+ # Comment contains ambiguous {}.
159
+ " RUF003" ,
160
+ # Mutable class attributes should be annotated with `typing.ClassVar`
161
+ " RUF012" ,
162
+ # Use of `assert` detected
163
+ " S101" ,
164
+ # Yoda condition detected
165
+ " SIM300" ,
166
+ # Add `from __future__ import annotations` to simplify
167
+ # (It's harder to keep annotations resolvable at the runtime with it.)
168
+ " FA100" ,
169
+ ]
170
+
171
+ [tool .ruff .lint .flake8-tidy-imports ]
172
+ banned-module-level-imports = [
173
+ " twisted.internet.reactor" ,
174
+ ]
175
+
176
+ [tool .ruff .lint .isort ]
177
+ split-on-trailing-comma = false
178
+
179
+ [tool .ruff .lint .per-file-ignores ]
180
+ "example/*" = [" PLC0415" ]
181
+ # scrapy_poet/__init__.py: Automatic import sorting causes circular dependencies.
182
+ "scrapy_poet/__init__.py" = [" F401" , " I" ]
183
+ "scrapy_poet/page_inputs/__init__.py" = [" F401" ]
184
+ "tests/*" = [" SLOT000" , " S" ]
185
+
186
+ # we need to use typing.Set[] over modern alternatives with web-poet<0.19.0 && Python<3.11
187
+ # see https://github.com/scrapinghub/web-poet/pull/219
188
+ "scrapy_poet/page_input_providers.py" = [" UP006" , " UP035" ]
189
+ "tests/test_downloader.py" =[" UP006" , " UP035" ]
190
+ "tests/test_providers.py" =[" UP006" , " UP035" ]
191
+ "tests/test_request_fingerprinter.py" =[" UP006" , " UP035" ]
192
+ "tests/test_web_poet_rules.py" =[" UP006" , " UP035" ]
193
+
194
+ [tool .ruff .lint .pydocstyle ]
195
+ convention = " pep257"
0 commit comments