jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085567?usp=email )
Change subject: [tests] replace daglint2 tests with docsig
......................................................................
[tests] replace daglint2 tests with docsig
Also fix some bugs.
Bug: T378801
Change-Id: I0b45581c43aded9187ffb81cd7ef268e3cfe137a
---
M .pre-commit-config.yaml
M pywikibot/data/api/_requests.py
M pywikibot/login.py
M pywikibot/page/_links.py
M pywikibot/page/_wikibase.py
M pywikibot/pagegenerators/_generators.py
M pywikibot/textlib.py
M tox.ini
8 files changed, 17 insertions(+), 17 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a8ee503..a2b1c16 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -77,6 +77,13 @@
hooks:
- id: isort
exclude: '^pwb\.py$'
+ - repo: https://github.com/jshwi/docsig
+ rev: v0.64.0
+ hooks:
+ - id: docsig
+ args:
+ -
"-dSIG101,SIG202,SIG203,SIG301,SIG302,SIG401,SIG402,SIG404,SIG501,SIG502,SIG503,SIG505"
+ exclude: ^(tests|scripts)
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
@@ -85,7 +92,6 @@
- --doctests
additional_dependencies:
# Due to incompatibilities between packages the order matters.
- - darglint2
- flake8-bugbear!=24.1.17
- flake8-comprehensions>=3.13.0
- flake8-mock-x2
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index 6679749..d0893f6 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -613,7 +613,7 @@
:param params: HTTP request params
:param mime_params: HTTP request parts which must be sent in the body
- :type mime_params: dict of (content, keytype, headers) # noqa: DAR103
+ :type mime_params: dict of (content, keytype, headers)
:return: HTTP request headers and body
"""
# construct a MIME message containing all API key/values
diff --git a/pywikibot/login.py b/pywikibot/login.py
index b670af6..c435773 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -497,7 +497,7 @@
def login_name(self, username: str) -> str:
"""Construct the login name from the username and suffix.
- :param user: username (without suffix)
+ :param username: username (without suffix)
"""
return f'{username}@{self.suffix}'
diff --git a/pywikibot/page/_links.py b/pywikibot/page/_links.py
index fe24dac..bf5e323 100644
--- a/pywikibot/page/_links.py
+++ b/pywikibot/page/_links.py
@@ -573,17 +573,15 @@
return link
@classmethod
- def langlinkUnsafe(cls, lang, title, source): # noqa: N802
+ def langlinkUnsafe(cls, lang: str, title: str, source): # noqa: N802
"""Create a "lang:title" Link linked from source.
Assumes that the lang & title come clean, no checks are made.
:param lang: target site code (language)
- :type lang: str
:param title: target Page
- :type title: str
:param source: Link from site source
- :param source: Site
+ :type source: Site
:rtype: pywikibot.page.Link
"""
@@ -785,11 +783,12 @@
}
-def html2unicode(text: str, ignore=None, exceptions=None) -> str:
+def html2unicode(text: str,
+ ignore: list[int] | None = None,
+ exceptions=None) -> str:
"""Replace HTML entities with equivalent unicode.
:param ignore: HTML entities to ignore
- :param ignore: list of int
"""
if ignore is None:
ignore = []
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index eb91dcd..34e3f58 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -1214,8 +1214,6 @@
:param site: Site to find the linked page of.
:type site: pywikibot.Site or database name
:param force: override caching
- :param get_redirect: return the item content, do not follow the
- redirect, do not raise an exception.
:raise IsRedirectPageError: instance is a redirect page
:raise NoSiteLinkError: site is not in :attr:`sitelinks`
"""
diff --git a/pywikibot/pagegenerators/_generators.py
b/pywikibot/pagegenerators/_generators.py
index e50cc54..ffe6752 100644
--- a/pywikibot/pagegenerators/_generators.py
+++ b/pywikibot/pagegenerators/_generators.py
@@ -155,7 +155,7 @@
"""Iterate Page objects for all new titles in a single namespace.
:param site: Site for generator results.
- :param namespace: namespace to retrieve pages from
+ :param namespaces: namespace to retrieve pages from
:param total: Maxmium number of pages to retrieve in total
"""
# API does not (yet) have a newpages function, so this tries to duplicate
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index d8e67f9..b6966c8 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1394,7 +1394,7 @@
:param links: interwiki links to be formatted
:type links: dict with the Site objects as keys, and Page
- or Link objects as values. # noqa: DAR103
+ or Link objects as values.
:param insite: site the interwiki links will be formatted for
(defaulting to the current site).
:type insite: BaseSite
diff --git a/tox.ini b/tox.ini
index 627dea7..4c83cfa 100644
--- a/tox.ini
+++ b/tox.ini
@@ -130,10 +130,7 @@
# R100: raise in except handler without from
# W503: line break before binary operator; against current PEP 8 recommendation
-# DARXXX: Darglint docstring issues to be solved
-# DAR000: T368849
-
-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
+ignore =
B007,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
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085567?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: I0b45581c43aded9187ffb81cd7ef268e3cfe137a
Gerrit-Change-Number: 1085567
Gerrit-PatchSet: 6
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]