@@ -21,23 +21,39 @@ filename = "zyte_api/__version__.py"
2121
2222[tool .coverage .run ]
2323branch = true
24-
25- [tool .coverage .report ]
26- exclude_also = [
27- " if TYPE_CHECKING:" ,
24+ patch = [
25+ " subprocess" ,
2826]
2927
28+ [tool .mypy ]
29+ allow_untyped_defs = false
30+ implicit_reexport = false
31+
32+ [[tool .mypy .overrides ]]
33+ module = " runstats"
34+ ignore_missing_imports = true
35+
36+ [[tool .mypy .overrides ]]
37+ module = " tests.*"
38+ allow_untyped_defs = true
39+
3040[tool .pytest .ini_options ]
3141filterwarnings = [
3242 " ignore:The zyte_api\\ .aio module is deprecated:DeprecationWarning"
3343]
3444
3545[tool .ruff .lint ]
3646extend-select = [
47+ # flake8-builtins
48+ " A" ,
49+ # flake8-async
50+ " ASYNC" ,
3751 # flake8-bugbear
3852 " B" ,
3953 # flake8-comprehensions
4054 " C4" ,
55+ # flake8-commas
56+ " COM" ,
4157 # pydocstyle
4258 " D" ,
4359 # flake8-future-annotations
@@ -84,6 +100,8 @@ extend-select = [
84100 " T10" ,
85101 # flake8-type-checking
86102 " TC" ,
103+ # flake8-tidy-imports
104+ " TID" ,
87105 # pyupgrade
88106 " UP" ,
89107 # pycodestyle warnings
@@ -92,6 +110,8 @@ extend-select = [
92110 " YTT" ,
93111]
94112ignore = [
113+ # Trailing comma missing
114+ " COM812" ,
95115 # Missing docstring in public module
96116 " D100" ,
97117 # Missing docstring in public class
@@ -144,21 +164,27 @@ ignore = [
144164 " S101" ,
145165]
146166
167+ [tool .ruff .lint .flake8-pytest-style ]
168+ parametrize-values-type = " tuple"
169+
170+ [tool .ruff .lint .flake8-tidy-imports ]
171+ banned-module-level-imports = [" twisted.internet.reactor" ]
172+
173+ [tool .ruff .lint .flake8-type-checking ]
174+ runtime-evaluated-decorators = [" attr.s" ]
175+
176+ [tool .ruff .lint .isort ]
177+ split-on-trailing-comma = false
178+
147179[tool .ruff .lint .per-file-ignores ]
148180"zyte_api/__init__.py" = [" F401" ]
149181"zyte_api/aio/errors.py" = [" F401" ]
150182"zyte_api/aio/retry.py" = [" F401" ]
151183"tests/*" = [" S" ]
152184"docs/**" = [" B006" ]
153185# Skip PEP 604 suggestions for files with attr classes
154- "zyte_api/errors.py" = [" UP007" ]
155- "zyte_api/stats.py" = [" UP007" ]
156-
157- [tool .ruff .lint .flake8-pytest-style ]
158- parametrize-values-type = " tuple"
159-
160- [tool .ruff .lint .flake8-type-checking ]
161- runtime-evaluated-decorators = [" attr.s" ]
186+ "zyte_api/errors.py" = [" UP007" , " UP045" ]
187+ "zyte_api/stats.py" = [" UP007" , " UP045" ]
162188
163189[tool .ruff .lint .pydocstyle ]
164190convention = " pep257"
0 commit comments