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