jenkins-bot submitted this change.
[pep8] fix pep8 issues in pywikibot using autopep8
Change-Id: I2f146e51b3dc18c9c1b20341d3ca2b2839c9ecf8
---
M pywikibot/data/wikistats.py
M pywikibot/proofreadpage.py
M pywikibot/version.py
M tox.ini
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index bfb6892..23b2547 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -129,10 +129,10 @@
# take the first entry to determine the sorting key
first_entry = table[0]
if first_entry[key].isdigit():
- sort_key = lambda d: int(d[key]) # noqa: E731
+ def sort_key(d): return int(d[key])
reverse = reverse if reverse is not None else True
else:
- sort_key = lambda d: d[key] # noqa: E731
+ def sort_key(d): return d[key]
reverse = reverse if reverse is not None else False
return sorted(table, key=sort_key, reverse=reverse)
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index 90e2a03..5a14de2 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -324,6 +324,7 @@
Decompose text if needed and recompose text.
"""
+
def wrapper(self: ProofreadPage, *args: Any, **kwargs: Any) -> Any:
if not hasattr(self, '_full_header'):
self._decompose_page()
@@ -336,6 +337,7 @@
def check_if_cached(fn: Callable) -> Callable: # type: ignore
"""Decorator for IndexPage to ensure data is cached."""
+
def wrapper(self: IndexPage, *args: Any, **kwargs: Any) -> Any:
if self._cached is False:
self._get_page_mappings()
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 722a377..3d33a29 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -412,8 +412,8 @@
info['path'] = path
assert path not in paths, \
- 'Path {} of the package {} is in defined paths as {}' \
- .format(path, name, paths[path])
+ 'Path {} of the package {} is in defined paths as {}' \
+ .format(path, name, paths[path])
paths[path] = name
if '__version__' in package.__dict__:
diff --git a/tox.ini b/tox.ini
index 4646d5e..9e4f8d8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -118,6 +118,7 @@
# 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
# H23: Python 3 compatibility tests
@@ -137,13 +138,13 @@
# 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,H101,H231,H232,H233,H234,H235,H236,H237,H238,H301,H306,H404,H405,H903,R100,W503
+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
enable-extensions = H203,H204,H205,N818
count = True
exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
format = %(blue)s%(path)s%(reset)s: %(bold)sline %(row)d:%(reset)s%(col)d: %(bold)s%(red)s%(code)s%(reset)s %(text)s
-max-complexity = 50
+max-complexity = 49
# The following are to be fixed
# N802: function name should be lowercase
To view, visit change 1052366. To unsubscribe, or for help writing mail filters, visit settings.