Skip to content

Commit 6a89b65

Browse files
authored
style: Ruff rules maintenance (OSGeo#5073)
Enable new group of rules, handle renamed rules, remove fixed rules
1 parent 66050f0 commit 6a89b65

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

pyproject.toml

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ select = [
2929
"AIR", # Airflow (AIR)
3030
"ANN", # flake8-annotations (ANN)
3131
"ARG", # flake8-unused-arguments (ARG)
32+
"ASYNC", # flake8-async (ASYNC)
3233
"B", # flake8-bugbear (B)
3334
"BLE", # flake8-blind-except (BLE)
3435
"C4", # flake8-comprehensions (C4)
@@ -38,9 +39,11 @@ select = [
3839
"D209", # pydocstyle (D) new-line-after-last-paragraph
3940
"D211", # pydocstyle (D) blank-line-before-class
4041
"D212", # pydocstyle (D) multi-line-summary-first-line
42+
"DOC", # pydoclint (DOC)
4143
"DTZ", # flake8-datetimez (DTZ)
4244
"E", # pycodestyle (E, W)
4345
"EM", # flake8-errmsg (EM)
46+
"EXE", # flake8-executable (EXE)
4447
"F", # Pyflakes (F)
4548
"FA", # flake8-future-annotations (FA)
4649
"FBT", # flake8-boolean-trap (FBT)
@@ -49,11 +52,13 @@ select = [
4952
"G", # flake8-logging-format (G)
5053
"I", # isort (I)
5154
"ICN", # flake8-import-conventions (ICN)
55+
"INP", # flake8-no-pep420 (INP)
5256
"INT", # flake8-gettext (INT)
5357
"ISC", # flake8-implicit-str-concat (ISC)
5458
"LOG", # flake8-logging (LOG)
5559
"N", # pep8-naming (N)
5660
"NPY", # NumPy-specific rules (NPY)
61+
"PD", # pandas-vet (PD)
5762
"PERF", # Perflint (PERF)
5863
"PGH", # pygrep-hooks (PGH)
5964
"PIE", # flake8-pie (PIE)
@@ -74,7 +79,7 @@ select = [
7479
"SLF", # flake8-self (SLF)
7580
"SLOT", # flake8-slots (SLOT)
7681
"T10", # flake8-debugger (T10)
77-
"TCH", # flake8-type-checking (TCH)
82+
"TC", # flake8-type-checking (TC)
7883
"TID", # flake8-tidy-imports (TID)
7984
"TRY", # tryceratops (TRY)
8085
"UP", # pyupgrade (UP)
@@ -87,7 +92,14 @@ ignore = [
8792
# *GRASS TODO: fix the issues, or use https://docs.astral.sh/ruff/settings/#lint_per-file-ignores
8893
"A001", # builtin-variable-shadowing
8994
"A002", # builtin-argument-shadowing
90-
"ANN", # flake8-annotations (ANN)
95+
"ANN001", # missing-type-function-argument
96+
"ANN002", # missing-type-args
97+
"ANN003", # missing-type-kwargs
98+
"ANN201", # missing-return-type-undocumented-public-function
99+
"ANN202", # missing-return-type-private-function
100+
"ANN204", # missing-return-type-special-method
101+
"ANN205", # missing-return-type-static-method
102+
"ANN206", # missing-return-type-class-method
91103
"ARG001", # unused-function-argument
92104
"ARG002", # unused-method-argument
93105
"ARG005", # unused-lambda-argument
@@ -105,8 +117,7 @@ ignore = [
105117
"BLE001", # blind-except
106118
"C414", # unnecessary-double-cast-or-process
107119
"COM812", # missing-trailing-comma
108-
"COM818", # trailing-comma-on-bare-tuple
109-
"D1",
120+
"D1", # pydocstyle (D), undocumented-*
110121
"D200", # unnecessary-multiline-docstring
111122
"D202", # blank-line-after-function (selected)
112123
"D203", # incorrect-blank-line-before-class (ignored, use D211)
@@ -116,18 +127,21 @@ ignore = [
116127
"D213", # multi-line-summary-second-line (ignored, use D212)
117128
"D214", # overindented-section
118129
"D301", # escape-sequence-in-docstring
119-
"D400", # ends-in-period
130+
"D400", # missing-trailing-period
120131
"D401", # non-imperative-mood
121-
"D403", # first-line-capitalized
132+
"D403", # first-word-uncapitalized
122133
"D404", # docstring-starts-with-this
123-
"D405", # capitalize-section-name
124-
"D407", # dashed-underline-after-section
125-
"D409", # section-underline-matches-section-length
134+
"D405", # non-capitalized-section-name
135+
"D407", # missing-dashed-underline-after-section
136+
"D409", # mismatched-section-underline-length
126137
"D412", # blank-lines-between-header-and-content
127-
"D413", # blank-line-after-last-section
128-
"D415", # ends-in-punctuation
129-
"D416", # section-name-ends-in-colon
138+
"D413", # missing-blank-line-after-last-section
139+
"D415", # missing-terminal-punctuation
140+
"D416", # missing-section-name-colon
130141
"D419", # empty-docstring
142+
"DOC201", # docstring-missing-returns
143+
"DOC402", # docstring-missing-yields
144+
"DOC501", # docstring-missing-exception
131145
"DTZ001", # call-datetime-without-tzinfo
132146
"DTZ002", # call-datetime-today
133147
"DTZ005", # call-datetime-now-without-tzinfo
@@ -138,16 +152,19 @@ ignore = [
138152
"E721", # type-comparison
139153
"E722", # bare-except
140154
"E741", # ambiguous-variable-name
155+
"EXE001", # shebang-not-executable
156+
"EXE002", # shebang-missing-executable-file
141157
"F403", # undefined-local-with-import-star
142158
"F405", # undefined-local-with-import-star-usage
143159
"F811", # redefined-while-unused
144160
"F821", # undefined-name
145161
"F822", # undefined-export
146-
"F841", # unused-variable,
162+
"F841", # unused-variable
147163
"FBT001", # boolean-type-hint-positional-argument
148164
"FBT002", # boolean-default-value-positional-argument
149165
"FBT003", # boolean-positional-value-in-call
150166
"I001", # unsorted-imports
167+
"INP001", # implicit-namespace-package
151168
"ISC003", # explicit-string-concatenation
152169
"N801", # invalid-class-name
153170
"N802", # invalid-function-name
@@ -174,7 +191,7 @@ ignore = [
174191
"PLR0914", # too-many-locals
175192
"PLR0915", # too-many-statements
176193
"PLR0916", # too-many-boolean-expressions
177-
"PLR0917", # too-many-positional
194+
"PLR0917", # too-many-positional-arguments
178195
"PLR1702", # too-many-nested-blocks
179196
"PLR1704", # redefined-argument-from-local
180197
"PLR2004", # magic-value-comparison

0 commit comments

Comments
 (0)