@@ -44,10 +44,94 @@ markers = [
44
44
]
45
45
46
46
[tool .ruff ]
47
+ line-length = 88
47
48
target-version = " py311"
48
49
49
50
[tool .ruff .lint ]
50
- select = [" E4" , " E7" , " E9" , " F" , " I" ]
51
+ select = [
52
+ " C4" , # comprehensions
53
+ " D" , # pydocstyle
54
+ " E" , # pycodestyle
55
+ " EXE" , # flake8-executable
56
+ " F" , # pyflakes
57
+ " FA" , # flake8-future-annotations
58
+ " G" , # flake8-logging-format
59
+ " FLY" , # flynt (format string conversion)
60
+ " I" , # isort
61
+ " ICN" , # flake8-import-conventions
62
+ " INP" , # flake8-no-pep420 (implicit namespace packages)
63
+ " ISC" , # flake8-implicit-str-concat
64
+ " PGH" , # pygrep-hooks
65
+ " PIE" , # flake8-pie
66
+ " PL" , # pylint
67
+ " RET" , # flake8-return
68
+ " RUF" , # ruff-specific rules
69
+ " SIM" , # flake8-simplify
70
+ " T10" , # flake8-debugger
71
+ " T20" , # flake8-print
72
+ " TID" , # flake8-tidy-imports
73
+ " UP" , # pyupgrade
74
+ " YTT" , # flake8-2020
75
+ ]
76
+ ignore = [
77
+ " B008" , # do not perform function calls in argument defaults
78
+ " B028" , # required stacklevel argument to warn
79
+ " B904" , # raise from e or raise from None in exception handlers
80
+ " B905" , # zip-without-explicit-strict
81
+ " C408" , # dict(...) as literal
82
+ " C901" , # too complex
83
+ " D100" , # public module
84
+ " D101" , # public class
85
+ " D102" , # public method
86
+ " D103" , # public function
87
+ " D104" , # public package
88
+ " D105" , # magic methods
89
+ " D106" , # nested class
90
+ " D107" , # init
91
+ " D202" , # blank lines after function docstring
92
+ " D203" , # blank line before class docstring
93
+ " D213" , # Multi-line docstring summary should start at the second line
94
+ " D401" , # Imperative mood
95
+ " D402" , # First line should not be the function's signature
96
+ " D413" , # Blank line required after last section
97
+ " E501" , # line-too-long, this is automatically enforced by ruff format
98
+ " E731" , # lambda-assignment
99
+ " ISC001" , # single line implicit string concat, handled by ruff format
100
+ " PGH003" , # blanket-type-ignore
101
+ " PLC0105" , # covariant type parameters should have a _co suffix
102
+ " PLR0124" , # name compared with self, e.g., a == a
103
+ " PLR0911" , # too many return statements
104
+ " PLR0912" , # too many branches
105
+ " PLR0913" , # too many arguments
106
+ " PLR0915" , # too many statements
107
+ " PLR2004" , # forces everything to be a constant
108
+ " PLW2901" , # overwriting loop variable
109
+ " RET504" , # unnecessary-assign, these are useful for debugging
110
+ " RET505" , # superfluous-else-return, stylistic choice
111
+ " RET506" , # superfluous-else-raise, stylistic choice
112
+ " RET507" , # superfluous-else-continue, stylistic choice
113
+ " RET508" , # superfluous-else-break, stylistic choice
114
+ " RUF005" , # splat instead of concat
115
+ " RUF012" , # Mutable class attributes should be annotated with `typing.ClassVar`
116
+ " S101" , # ignore "Use of `assert` detected"
117
+ " SIM102" , # nested ifs
118
+ " SIM108" , # convert everything to ternary operator
119
+ " SIM114" , # combine `if` branches using logical `or` operator
120
+ " SIM116" , # dictionary instead of `if` statements
121
+ " SIM117" , # nested with statements
122
+ " SIM118" , # remove .keys() calls from dictionaries
123
+ " SIM300" , # yoda conditions
124
+ " UP007" , # Optional[str] -> str | None
125
+ " UP038" , # non-pep604-isinstance, results in slower code
126
+ " W191" , # indentation contains tabs
127
+ ]
128
+ # none of these codes will be automatically fixed by ruff
129
+ unfixable = [
130
+ " T201" , # print statements
131
+ " F401" , # unused imports
132
+ " RUF100" , # unused noqa comments
133
+ " F841" , # unused variables
134
+ ]
51
135
52
136
[build-system ]
53
137
requires = [" poetry-core" ]
0 commit comments