jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085447?usp=email )

Change subject: [lint] use ruff selecting D instead of deprecated flake8 
pydocstyle
......................................................................

[lint] use ruff selecting D instead of deprecated flake8 pydocstyle

Change-Id: I4055ebdb5ac9582d1b3d4e684a7e4907131d57a8
---
M .pre-commit-config.yaml
M pyproject.toml
M tox.ini
3 files changed, 18 insertions(+), 15 deletions(-)

Approvals:
  JJMC89: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 528bb18..48d32f7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -48,6 +48,12 @@
       - id: python-check-blanket-type-ignore
       - id: python-check-mock-methods
       - id: python-use-type-annotations
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    rev: v0.7.1
+    hooks:
+      - id: ruff
+        args:
+        - --fix
   - repo: https://github.com/asottile/pyupgrade
     rev: v3.19.0
     hooks:
@@ -79,10 +85,8 @@
         additional_dependencies:
           # Due to incompatibilities between packages the order matters.
           - darglint2
-          - pydocstyle==6.3.0  # deprecated and no longer maintained
           - flake8-bugbear!=24.1.17
           - flake8-comprehensions>=3.13.0
-          - flake8-docstrings>=1.4.0
           - flake8-mock-x2
           - flake8-print>=5.0.0
           - flake8-quotes>=3.3.2
diff --git a/pyproject.toml b/pyproject.toml
index 24e9b90..38eb436 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -145,3 +145,12 @@
     "ignore-without-code",
 ]
 ignore_missing_imports = true
+
+[tool.ruff.lint]
+select = ["D"]
+ignore = ["D105", "D203", "D211", "D212", "D213", "D214", "D401", "D404", 
"D406", "D407", "D412", "D413", "D416", "D417"]
+
+[tool.ruff.lint.per-file-ignores]
+"pywikibot/families/*" = ["D102"]
+"scripts/dataextend.py" = ["D101", "D102"]
+"tests/ui_tests.py" = ["D102", "D103"]
diff --git a/tox.ini b/tox.ini
index 8f69dff..e98f12e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -118,8 +118,6 @@

 [flake8]
 # The following are intentionally ignored, possibly pending consensus
-# D105: Missing docstring in magic method
-# D211: No blank lines allowed before class docstring
 # E704: multiple statements on one line (def)
 # FI1: __future__ import "x" missing
 # H101: TODO format
@@ -132,15 +130,10 @@
 # R100: raise in except handler without from
 # W503: line break before binary operator; against current PEP 8 recommendation

-# Errors occurred after upgrade to pydocstyle 2.0.0 (T164142)
-# D401: First line should be in imperative mood; try rephrasing
-# D412: No blank lines allowed between a section header and its content
-# D413: Missing blank line after last section
-
 # DARXXX: Darglint docstring issues to be solved
 # DAR000: T368849

-ignore = 
B007,D105,D211,D401,D413,D412,DAR000,DAR003,DAR101,DAR102,DAR201,DAR202,DAR301,DAR401,DAR402,DAR501,E704,H101,H231,H232,H233,H234,H235,H236,H237,H238,H301,H306,H404,H405,H903,R100,W503
+ignore = 
B007,DAR000,DAR003,DAR101,DAR102,DAR201,DAR202,DAR301,DAR401,DAR402,DAR501,E704,H101,H231,H232,H233,H234,H235,H236,H237,H238,H301,H306,H404,H405,H903,R100,W503
 enable-extensions = H203,H204,H205,N818
 
 count = True
@@ -166,7 +159,6 @@
     pywikibot/date.py: N802, N803, N806, N816
     pywikibot/editor.py: N803, N806
     pywikibot/exceptions.py: H501
-    pywikibot/families/*: D102
     pywikibot/family.py: N802, N803, N806, N815
     pywikibot/fixes.py: E241
     pywikibot/interwiki_graph.py: N802, N803, N806
@@ -191,7 +183,7 @@
     scripts/clean_sandbox.py: N816
     scripts/commonscat.py: N802, N806, N816
     scripts/cosmetic_changes.py: N816
-    scripts/dataextend.py: C901, D101, D102, E501
+    scripts/dataextend.py: C901, E501
     scripts/harvest_template.py: N802, N816
     scripts/interwiki.py: N802, N803, N806, N816
     scripts/imagetransfer.py: N803, N806, N816
@@ -227,7 +219,7 @@
     tests/tools_formatter_tests.py: N802
     tests/tools_tests.py: N802
     tests/ui_options_tests.py: N802
-    tests/ui_tests.py: D102, D103, N802
+    tests/ui_tests.py: N802
     tests/wikibase_edit_tests.py: N802
     tests/wikibase_tests.py: N802
     tests/xmlreader_tests.py: N802
@@ -242,8 +234,6 @@

 [pycodestyle]
 exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
-# see explanations above
-ignore = D105,D211

 [pytest]
 minversion = 7.0.1

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085447?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4055ebdb5ac9582d1b3d4e684a7e4907131d57a8
Gerrit-Change-Number: 1085447
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to