forked from scrapy/scrapyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
50 lines (44 loc) · 2 KB
/
pyproject.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
[tool.ruff]
line-length = 119
target-version = "py38"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN", "COM", "EM",
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", "E501", "D206", "Q000", "Q001", "Q002", "Q003", "ISC001",
"D203", "D212", # ignore incompatible rules
"D200", # documentation preferences
"C901", "PLR0912", # complexity preferences
# Project-specific
"D",
"PTH", # Scrapyd hasn't adopted pathlib
"ARG002", # Unused method argument (txrequest argument isn't always used)
"N802", # Function name should be lowercase (Twisted uses method names like render_GET)
"N803", # Argument name should be lowercase (Twisted uses argument names like avatarId)
"N815", # Variable in class scope should not be mixedCase (Twisted uses class attributes like requestAvatarId)
"PLR0913", # Too many arguments to function call
"S603", # `subprocess` call: check for execution of untrusted input (informative)
# sqlite3 doesn't have functions like psycopg2.sql.Identifier and psycopg2.sql.SQL.format.
"S608", # Possible SQL injection vector through string-based query construction
# Scrapyd uses naive datetimes.
"DTZ001", # `datetime.datetime()` called without a `tzinfo` argument"
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument
"DTZ006", # `datetime.datetime.fromtimestamp()` called without a `tz` argument
"DTZ007", # Naive datetime constructed using `datetime.datetime.strptime()` without %z
]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["copyright"]
[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["INP001"] # no __init__.py file
"scrapyd/__main__.py" = ["T201"] # `print` found
"scrapyd/interfaces.py" = ["N805"] # First argument of a method should be named `self`
"{tests,integration_tests}/*" = [
"D", # docstring
"S101", # assert
"S106", # password
"S113", # requests timeout
"PLR2004", # magic value
"ARG001", "ARG002", "ARG005", # mocks
"PT009", "PT027", # Scrapyd mixes unittest with pytest
]