Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1185308?usp=email )

Change subject: mypy: test config.py with pre-commit
......................................................................

mypy: test config.py with pre-commit

Change-Id: I2a25f99dbc413f4f0bdc3f110c01fa4f0dbd5f2a
---
M .pre-commit-config.yaml
M conftest.py
M pywikibot/config.py
3 files changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index abfaca0..dfbfd77 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -65,7 +65,7 @@
         language: python
         require_serial: true
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.12.11
+    rev: v0.12.12
     hooks:
       - id: ruff-check
         alias: ruff
@@ -122,7 +122,7 @@
         # Test for files which already passed in past.
         # They should be also used in conftest.py to exclude them from 
non-voting mypy test.
         files: >
-          ^pywikibot/(__metadata__|echo|exceptions|fixes|time)\.py$|
+          ^pywikibot/(__metadata__|config|echo|exceptions|fixes|time)\.py$|
           ^pywikibot/(comms|data|families|specialbots)/__init__\.py$|
           ^pywikibot/families/[a-z][a-z\d]+_family\.py$|
           ^pywikibot/page/(__init__|_decorators|_revision)\.py$|
diff --git a/conftest.py b/conftest.py
index 830c04c..ebc6027 100644
--- a/conftest.py
+++ b/conftest.py
@@ -16,7 +16,7 @@

 EXCLUDE_PATTERN = re.compile(
     r'(?:'
-    r'(__metadata__|echo|exceptions|fixes|time)|'
+    r'(__metadata__|config|echo|exceptions|fixes|time)|'
     r'(comms|data|families|specialbots)/__init__|'
     r'families/[a-z][a-z\d]+_family|'
     r'page/(__init__|_decorators|_revision)|'
diff --git a/pywikibot/config.py b/pywikibot/config.py
index 113e766..e322f35 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -33,7 +33,7 @@
    default. Editor detection functions were moved to :mod:`editor`.
 """
 #
-# (C) Pywikibot team, 2003-2024
+# (C) Pywikibot team, 2003-2025
 #
 # Distributed under the terms of the MIT license.
 #
@@ -937,7 +937,8 @@
     _filestatus = os.stat(_filename)
     _filemode = _filestatus[0]
     _fileuid = _filestatus[4]
-    if not OSWIN32 and _fileuid not in [os.getuid(), 0]:
+    if not OSWIN32 \
+       and _fileuid not in [os.getuid(), 0]:  # type: ignore[attr-defined]
         warning(f'Skipped {_filename!r}: owned by someone else.')
     elif OSWIN32 or _filemode & 0o02 == 0:
         with open(_filename, 'rb') as f:

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1185308?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: I2a25f99dbc413f4f0bdc3f110c01fa4f0dbd5f2a
Gerrit-Change-Number: 1185308
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[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]

Reply via email to