jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/396918 )
Change subject: tox.ini: Add flake8_invalid_escape_sequences
......................................................................
tox.ini: Add flake8_invalid_escape_sequences
This pluging will tell if there are invalid escape sequences in the source
code.
Also fix exising errors. Keep lines under 80 characters.
Change-Id: Ibb8b4a799304134edb4f4c8fc81ef1874e36a993
---
M tests/category_tests.py
M tests/namespace_tests.py
M tox.ini
3 files changed, 13 insertions(+), 6 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/category_tests.py b/tests/category_tests.py
index 0d3f2d6..671317d 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -18,7 +18,7 @@
"""Test Category object."""
NOCATEGORYNAMESPACE_RE = '\'(.*?)\' is not in the category
namespace!'
- NOREDIRECTPAGE_RE = 'Page \[\[(.*?)\]\] is not a redirect page.'
+ NOREDIRECTPAGE_RE = r'Page \[\[(.*?)\]\] is not a redirect page.'
family = 'wikipedia'
code = 'en'
diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index 1b35582..d88bf5f 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -229,9 +229,15 @@
"""Test static/classmethods in Namespace replaced by
NamespacesDict."""
- CONTAINSINAPPROPRIATE_RE = 'identifiers contains inappropriate types: (.*?)'
- INTARGNOTSTRINGORNUMBER_RE = 'int\(\) argument must be a string or a number, not
\'(.*?)\''
- NAMESPACEIDNOTRECOGNISED_RE = 'Namespace identifier\(s\) not recognised:
(.*?)'
+ CONTAINSINAPPROPRIATE_RE = (
+ r'identifiers contains inappropriate types: (.*?)'
+ )
+ INTARGNOTSTRINGORNUMBER_RE = (
+ r"int\(\) argument must be a string or a number, not '(.*?)'"
+ )
+ NAMESPACEIDNOTRECOGNISED_RE = (
+ r'Namespace identifier\(s\) not recognised: (.*?)'
+ )
net = False
@@ -377,8 +383,8 @@
"""Test NamespacesDict.__getitem__."""
- VALIDNUMBER_RE = '-?(0|[1-9]\d*)'
- EMPTYTEXT_RE = '\s*'
+ VALIDNUMBER_RE = r'-?(0|[1-9]\d*)'
+ EMPTYTEXT_RE = r'\s*'
net = False
diff --git a/tox.ini b/tox.ini
index 4221381..422ac52 100644
--- a/tox.ini
+++ b/tox.ini
@@ -69,6 +69,7 @@
flake8-print>=2.0.1
flake8-mock>=0.3
pep8-naming
+ flake8_invalid_escape_sequences
# 4a226d07 is
https://github.com/erikrose/blessings/pull/104
[testenv:flake8-diff]
--
To view, visit
https://gerrit.wikimedia.org/r/396918
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb8b4a799304134edb4f4c8fc81ef1874e36a993
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>