jenkins-bot has submitted this change and it was merged.
Change subject: Enable flake8 rule E241 ......................................................................
Enable flake8 rule E241
Fix for minor cases, and ignore for specific cases which would require large changes.
Change-Id: I54742db3c7c336a514729889f85f1d10e94341e4 --- M pywikibot/data/wikistats.py M pywikibot/families/commons_family.py M scripts/commonscat.py M scripts/featured.py M scripts/imagecopy_self.py M scripts/redirect.py M scripts/replace.py M scripts/script_wui.py M setup.py M tests/timestripper_tests.py M tox.ini 11 files changed, 24 insertions(+), 19 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py index fbf928d..cae468f 100644 --- a/pywikibot/data/wikistats.py +++ b/pywikibot/data/wikistats.py @@ -37,10 +37,10 @@
FAMILY_MAPPING = { 'anarchopedia': 'anarchopedias', - 'wikipedia': 'wikipedias', - 'wikiquote': 'wikiquotes', - 'wikisource': 'wikisources', - 'wiktionary': 'wiktionaries', + 'wikipedia': 'wikipedias', + 'wikiquote': 'wikiquotes', + 'wikisource': 'wikisources', + 'wiktionary': 'wiktionaries', }
MISC_SITES_TABLE = 'mediawikis' diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py index b1776b8..2ffaae6 100644 --- a/pywikibot/families/commons_family.py +++ b/pywikibot/families/commons_family.py @@ -41,7 +41,7 @@ }
self.disambcatname = { - 'commons': u'Disambiguation' + 'commons': 'Disambiguation' }
# Subpages for documentation. diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 5baf436..a9ee7d8 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -136,7 +136,7 @@ 'sco': ('Commons category', ['Commonscat', 'Commons cat']), 'ru': (u'Commonscat', [u'Викисклад-кат', u'Commons category']), 'simple': (u'Commonscat', - [u'Commons cat', u'Commons cat multi', u'Commons category', + ['Commons cat', 'Commons cat multi', 'Commons category', u'Commons category multi', u'CommonsCompact', u'Commons-inline']), 'sh': (u'Commonscat', [u'Commons cat']), diff --git a/scripts/featured.py b/scripts/featured.py index c49a5dc..672e545 100755 --- a/scripts/featured.py +++ b/scripts/featured.py @@ -192,7 +192,7 @@ 'fa': (BACK, u"فهرست برگزیده"), 'id': (BACK, u'Featured list'), 'ja': (BACK, u'Featured List'), - 'ksh': (CAT, u"Joode Leß"), + 'ksh': (CAT, 'Joode Leß'), 'no': (BACK, u'God liste'), 'pl': (BACK, u'Medalista'), 'pt': (BACK, u'Anexo destacado'), @@ -222,7 +222,7 @@ def __init__(self, **kwargs): """Only accepts options defined in availableOptions.""" self.availableOptions.update({ - 'async': False, # asynchron putting a page? + 'async': False, # True for asynchronously putting a page 'afterpage': u"!", 'count': False, # featuredcount 'featured': False, diff --git a/scripts/imagecopy_self.py b/scripts/imagecopy_self.py index 18480f5..6d9b400 100644 --- a/scripts/imagecopy_self.py +++ b/scripts/imagecopy_self.py @@ -92,7 +92,7 @@ }
moveToCommonsTemplate = { - 'de': [u'NowCommons', u'NC', u'NCT', u'Nowcommons'], + 'de': ['NowCommons', 'NC', 'NCT', 'Nowcommons'], 'en': [u'Commons ok', u'Copy to Wikimedia Commons', u'Move to commons', u'Movetocommons', u'To commons', u'Copy to Wikimedia Commons by BotMultichill'], diff --git a/scripts/redirect.py b/scripts/redirect.py index a968711..edfa28d 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -527,7 +527,7 @@ for redir_name in self.generator.retrieve_double_redirects(): self.fix_1_double_redirect(redir_name)
- def fix_1_double_redirect(self, redir_name): + def fix_1_double_redirect(self, redir_name): if isinstance(redir_name, basestring): redir = pywikibot.Page(self.site, redir_name) else: diff --git a/scripts/replace.py b/scripts/replace.py index 8fd216d..0941a59 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -821,10 +821,10 @@ replacements = [] # Don't edit pages which contain certain texts. exceptions = { - 'title': [], + 'title': [], 'text-contains': [], - 'inside': [], - 'inside-tags': [], + 'inside': [], + 'inside-tags': [], 'require-title': [], # using a seperate requirements dict needs some } # major refactoring of code.
diff --git a/scripts/script_wui.py b/scripts/script_wui.py index a5d9df5..e247701 100755 --- a/scripts/script_wui.py +++ b/scripts/script_wui.py @@ -146,7 +146,8 @@ self.templ = templ.title() self.cron = cron.title() self.refs = {self.templ: templ, - self.cron: cron, } + self.cron: cron, + } pywikibot.output(u'** Pre-loading all relevant page contents') for item in self.refs: # security; first check if page is protected, reject any data if not diff --git a/setup.py b/setup.py index 9441c84..c4bc221 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ extra_deps = { # Core library dependencies 'isbn': ['python-stdnum'], - 'Graphviz': ['pydot>=1.0.28'], + 'Graphviz': ['pydot>=1.0.28'], 'Google': ['google>=1.7'], 'IRC': [irc_dep], 'mwparserfromhell': ['mwparserfromhell>=0.3.3'], diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py index 4c5a9fc..fe267b9 100644 --- a/tests/timestripper_tests.py +++ b/tests/timestripper_tests.py @@ -188,8 +188,8 @@ 'match': '19:48, ngày 3 tháng 2 năm 2011 (UTC) 19:48, ngày 7 tháng 2 năm 2010 (UTC)', 'match2': '16:41, ngày 15 tháng 9 năm 2001 (UTC) 16:41, ' 'ngày 12 tháng 9 năm 2008 (UTC)', - 'match3': '21:18, ngày 13 tháng 8 năm 2011 (UTC) 21:18, ' - 'ngày 14 tháng 8 năm 2014 (UTC)', + 'match3': '21:18, ngày 13 tháng 8 năm 2011 (UTC) 21:18, ' + 'ngày 14 tháng 8 năm 2014 (UTC)', 'nomatch1': '21:18, ngày 13 March 8 năm 2011 (UTC) 21:18, ' 'ngày 14 March 8 năm 2014 (UTC)', }, diff --git a/tox.ini b/tox.ini index a24e41d..ac5a94b 100644 --- a/tox.ini +++ b/tox.ini @@ -78,7 +78,7 @@ -rdocs/requirements-py3.txt
[flake8] -ignore = E241,E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H202,H236,H301,H404,H405,I100,I101,P102,P103 +ignore = E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H202,H236,H301,H404,H405,I100,I101,P102,P103 exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/* max_line_length = 130 accept-encodings = utf-8 @@ -86,6 +86,10 @@ putty-ignore = generate_family_file.py : +D102 pywikibot/cosmetic_changes.py : +D102, D103 + pywikibot/date.py,pywikibot/family.py,pywikibot/fixes.py,pywikibot/textlib.py,pywikibot/userinterfaces/terminal_interface_unix.py,pywikibot/userinterfaces/terminal_interface_win32.py,pywikibot/families/wikipedia_family.py : +E241 + tests/page_tests.py : +E241 + scripts/,/pagegenerators.parameterHelp/ : +E241 + scripts/blockreview.py,scripts/imagetransfer.py,scripts/interwiki.py,scripts/maintenance/wikimedia_sites.py : +E241 tests/deprecation_tests.py,tests/pagegenerators_tests.py,tests/site_tests.py,tests/textlib_tests.py,tests/wikibase_tests.py : +D102 tests/ui_tests.py : +D102, D103 scripts/archivebot.py,scripts/casechecker.py,scripts/commons_link.py,scripts/cfd.py,scripts/featured.py,scripts/imagecopy.py,scripts/imagecopy_self.py,scripts/interwiki.py,scripts/replicate_wiki.py,scripts/solve_disambiguation.py,scripts/maintenance/compat2core.py : +D102, D103 @@ -93,7 +97,7 @@ scripts/catall.py,scripts/imageharvest.py,scripts/makecat.py,scripts/maintenance/cache.py,scripts/maintenance/wikimedia_sites.py : +D103
[pep8] -ignore = E241,E402,E731 +ignore = E402,E731 exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/* max_line_length = 130