Skip to content

Commit 4684db3

Browse files
chore(lint): migrate from pydocstyle to ruff (#7346)
pydocstyle has been deprecated and archived (Nov 2023). The maintainers recommend migrating to Ruff, which has full parity with pydocstyle. Changes: - Add "D" (pydocstyle) rules to ruff.toml select list - Migrate ignore rules from .pydocstyle.ini to ruff.toml - Remove pydocstyle from CI workflow - Delete .pydocstyle.ini This also fixes false positives like D402 being triggered incorrectly when a method named `name` has a docstring containing "name" anywhere. See: https://github.com/PyCQA/pydocstyle (archived) Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
1 parent 117dc73 commit 4684db3

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/general-linting.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
if [ -n "${{ env.diff_files }}" ]; then
6767
black --diff --check ${{ env.diff_files }}
6868
mypy ${{ env.diff_files }} --ignore-missing-imports --scripts-are-modules --check-untyped-defs
69-
pydocstyle ${{ env.diff_files }}
7069
pylint ${{ env.diff_files }}
7170
ruff check ${{ env.diff_files }}
7271
else

.pydocstyle.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

ruff.toml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fix = true
1414

1515
[lint]
1616
select = [
17+
"D",
1718
"E",
1819
"W",
1920
"F",
@@ -28,8 +29,35 @@ select = [
2829
"SIM",
2930
"T20",
3031
]
31-
# These ignores should be seen as temporary solutions to problems that will NEED fixed
32-
ignore = ["PLR2004", "PLR0913", "PLR0915", "PLC0415", "E402"]
32+
ignore = [
33+
"PLR2004", # magic-value-comparison
34+
"PLR0913", # too-many-arguments
35+
"PLR0915", # too-many-statements
36+
"PLC0415", # import-outside-top-level
37+
"E402", # module-import-not-at-top-of-file
38+
# Docstring style choices (migrated from .pydocstyle.ini)
39+
"D202", # no-blank-line-after-function
40+
"D203", # one-blank-line-before-class
41+
"D205", # blank-line-after-summary
42+
"D210", # surrounding-whitespace
43+
"D212", # multi-line-summary-first-line
44+
"D213", # multi-line-summary-second-line
45+
"D214", # section-not-over-indented
46+
"D215", # section-underline-not-over-indented
47+
"D400", # ends-in-period
48+
"D404", # docstring-starts-with-this
49+
"D405", # capitalize-section-name
50+
"D406", # new-line-after-section-name
51+
"D407", # dashed-underline-after-section
52+
"D408", # section-underline-after-name
53+
"D409", # section-underline-matches-section-length
54+
"D410", # no-blank-line-after-section
55+
"D411", # no-blank-line-before-section
56+
"D413", # blank-line-after-last-section
57+
"D415", # ends-in-punctuation
58+
"D416", # section-name-ends-in-colon
59+
"D417", # undocumented-param
60+
]
3361

3462
[lint.per-file-ignores]
3563
"**/tests/*" = ["S101"]

0 commit comments

Comments
 (0)