8
8
# https://docs.astral.sh/ruff/configuration/
9
9
line-length = 100
10
10
preview = true
11
- required-version = " >=0.11.0" # tool.ruff.target-version is infered from project.requires-python
11
+ required-version = " >=0.11.0" # tool.ruff.target-version is inferred from project.requires-python
12
12
13
13
[format ]
14
14
docstring-code-format = true
@@ -20,7 +20,7 @@ ignore = [
20
20
# ##
21
21
# Not needed or wanted
22
22
# ##
23
- " D1" , # pydocstyle Missing doctring
23
+ " D1" , # pydocstyle Missing docstring
24
24
" D401" , # pydocstyle: non-imperative-mood
25
25
" EM" , # flake8-errmsg
26
26
# This is often something we can't control: https://github.com/astral-sh/ruff/issues/9497
@@ -47,6 +47,15 @@ ignore = [
47
47
" D212" , # pydocstyle: multi-line-summary-first-line
48
48
# Allow differentiating between broken (FIXME) and to be done/added/completed (TODO)
49
49
" TD001" , # flake8-todos: invalid-todo-tag
50
+ # Often just leads to redundant more verbose code when needing an actual str
51
+ " PTH208" , # Use `pathlib.Path.iterdir()` instead.
52
+ # Typeshed doesn't want complex or non-literal defaults for maintenance and testing reasons.
53
+ # This doesn't affect us, let's have more complete stubs.
54
+ # This doesn't affect us, let's have more complete stubs.
55
+ " PYI011" , # typed-argument-default-in-stub
56
+ " PYI011" , # typed-argument-default-in-stub
57
+ " PYI014" , # argument-default-in-stub
58
+ " PYI053" , # string-or-bytes-too-long
50
59
51
60
# ##
52
61
# These should be warnings (https://github.com/astral-sh/ruff/issues/1256 & https://github.com/astral-sh/ruff/issues/1774)
@@ -57,6 +66,8 @@ ignore = [
57
66
58
67
# False-positives
59
68
" TC004" , # https://github.com/astral-sh/ruff/issues/3821
69
+ # Too many magic number "2" that are preferable inline. https://github.com/astral-sh/ruff/issues/10009
70
+ " PLR2004" , # magic-value-comparison
60
71
61
72
# ##
62
73
# Conflict with formatter (you can remove this section if you don't use Ruff as a formatter)
@@ -107,8 +118,6 @@ allow-multiline = false
107
118
[lint .isort ]
108
119
combine-as-imports = true
109
120
split-on-trailing-comma = false
110
- # This should be automatically detected in src layout, but somehow pre-commit messes it up
111
- known-first-party = [" gen" ]
112
121
113
122
# https://docs.astral.sh/ruff/settings/#mccabe
114
123
[lint .mccabe ]
@@ -149,8 +158,8 @@ max-branches = 15
149
158
"cv2.imread".msg = """ \
150
159
it doesn't support special characters. \
151
160
Use `cv2.imdecode(np.fromfile(filename, dtype=np.uint8), flags)` instead.
152
- https://github.com/opencv/opencv/issues/4292 #issuecomment-2266019697 """
161
+ https://github.com/opencv/opencv/issues/18305 #issuecomment-2847972863 """
153
162
"cv2.imwrite".msg = """ \
154
163
it doesn't support special characters. \
155
164
Use `cv2.imencode(os.path.splitext(filename)[1], img)[1].tofile(filename)` instead.
156
- https://github.com/opencv/opencv/issues/4292 #issuecomment-2266019697 """
165
+ https://github.com/opencv/opencv/issues/18305 #issuecomment-2847972863 """
0 commit comments