-
Notifications
You must be signed in to change notification settings - Fork 65
/
pyproject.toml
123 lines (113 loc) · 4.4 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
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
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["-v", "-l", "--color=yes", "--code-highlight=yes"]
[tool.black]
line-length = 100
skip-string-normalization = true
target-version = ["py310", "py311"]
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.venv
| build
| dist
| tests/data
)/
'''
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
fixable = ["ALL"]
select = [
"B002", # Python does not support the unary prefix increment
"B007", # Loop control variable {name} not used within loop body
"B009", # Do not call getattr with a constant attribute value
"B010", # Do not call setattr with a constant attribute value
"B011", # Do not `assert False`, raise `AssertionError` instead
"B013", # Redundant tuple in exception handler
"B014", # Exception handler with duplicate exception
"B023", # Function definition does not bind loop variable {name}
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # Use raise from to specify exception cause
"BLE001", # Using bare except clauses is prohibited
"C", # complexity
"C4", # flake8-comprehensions
"COM818", # Trailing comma on bare tuple prohibited
# "D", # docstrings
"E", # pycodestyle
"F", # pyflakes/autoflake
"G", # flake8-logging-format
"I", # isort
"ISC001", # Implicitly concatenated string literals on one line
"N804", # First argument of a class method should be named cls
"N805", # First argument of a method should be named self
"N999", # Invalid module name: '{name}'
"PERF", # Perflint rules
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
"PLW", # pylint
"RUF", # Ruff-specific rules
"S103", # bad-file-permissions
"S108", # hardcoded-temp-file
"S110", # try-except-pass
"S112", # try-except-continue
"S306", # suspicious-mktemp-usage
"S307", # suspicious-eval-usage
"S601", # paramiko-call
"S602", # subprocess-popen-with-shell-equals-true
"S604", # call-with-shell-equals-true
"S609", # unix-command-wildcard-injection
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM208", # Use {expr} instead of not (not {expr})
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T100", # Trace found: {name} used
"T20", # flake8-print
"TRY004", # Prefer TypeError exception for invalid type
"TRY203", # Remove exception handler; error is immediately re-raised
"PLR0911", # Too many return statements ({returns} > {max_returns})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"UP", # pyupgrade
"W", # pycodestyle
]
ignore = [
"ANN", # flake8-annotations
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D406", # Section name should end with a newline
"D407", # Section name underlining
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
"G004", # Logging statement uses string formatting
"PLR0912", # Too many branches ({branches} > {max_branches})
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
"PLR0915", # Too many statements ({statements} > {max_statements})
"PLW0603", # Using the global statement
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
"D107", # Missing docstring in __init__
]
[tool.ruff.lint.per-file-ignores]
# Allow pprint for docs formatting
"docs/create_*.py" = ["T203"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"broker",
]
combine-as-imports = true
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.coverage.run]
omit = ["tests/*"]
include = ["nailgun/*.py"]