John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/255910

Change subject: Use flake8-putty to merge docstring rules
......................................................................

Use flake8-putty to merge docstring rules

flake8-putty allows per file ignore codes.

Change-Id: Id55b466b321357f2a6fc97ef5b93c0fee1f86d03
---
M pywikibot/_wbtypes.py
M tests/deprecation_tests.py
M tests/dry_site_tests.py
M tests/i18n_tests.py
M tests/isbn_tests.py
M tests/tools_formatter_tests.py
M tox.ini
7 files changed, 23 insertions(+), 172 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/10/255910/1

diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index 7d9d908..c59a5b8 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -20,6 +20,7 @@
     """Abstract class for Wikibase representations."""
 
     def __init__(self):
+        """Constructor."""
         raise NotImplementedError
 
     def toWikibase(self):
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index 8ecc982..97a58b5 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -120,11 +120,13 @@
 
 @remove_last_args(['foo', 'bar'])
 def deprecated_all():
+    """Test remove_last_args with all args removed."""
     return None
 
 
 @remove_last_args(['bar'])
 def deprecated_all2(foo):
+    """Test remove_last_args with one arg removed."""
     return foo
 
 
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index baa5687..b047221 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -210,6 +210,7 @@
     # Implemented without setUpClass(cls) and global variables as objects
     # were not completely disposed and recreated but retained 'memory'
     def setUp(self):
+        """Set up test method."""
         super(TestNeedVersion, self).setUp()
         self.version = lambda: "1.13"
 
diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index 9b68faf..de85354 100644
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -27,6 +27,7 @@
     net = False
 
     def setUp(self):
+        """Set up test method."""
         self.msg_localized = {'en': u'test-localized EN',
                               'nl': u'test-localized NL',
                               'fy': u'test-localized FY'}
diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index 9f69939..506b65a 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -179,6 +179,7 @@
 
     @classmethod
     def setUpClass(cls):
+        """Set up test class."""
         super(TestIsbnWikibaseBot, cls).setUpClass()
 
         # Check if the unit test item page and the property both exist
diff --git a/tests/tools_formatter_tests.py b/tests/tools_formatter_tests.py
index d6803f3..eb1a84b 100644
--- a/tests/tools_formatter_tests.py
+++ b/tests/tools_formatter_tests.py
@@ -38,7 +38,10 @@
 
     class DummyUnicode(UnicodeMixin):
 
+        """Dummy class that __unicode__ returns a non-ascii unicode value."""
+
         def __unicode__(self):
+            """Return ä."""
             return 'ä'
 
     net = False
diff --git a/tox.ini b/tox.ini
index 219485d..3359b84 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,16 +1,15 @@
 [tox]
 minversion = 1.6
 skipsdist = True
-envlist = flake8,flake8-py3,flake8-docstrings-mandatory,py26,py27,py34
+envlist = flake8,flake8-py3,py26,py27,py34
 
 [tox:jenkins]
 # Override default for WM Jenkins
 # Others are run in their own individual jobs on WM Jenkins
-envlist = flake8,flake8-py3,flake8-docstrings-mandatory
+envlist = flake8,flake8-py3
 
 [params]
 nose_skip = --ignore-files=(gui\.py|botirc\.py|rcstream\.py|api\.py)
-flake8_ignore = D102,D103,{[flake8]ignore}
 
 [testenv]
 setenv =
@@ -26,11 +25,12 @@
 [testenv:flake8]
 commands =
     flake8 --version
-    flake8 --ignore={[params]flake8_ignore} {posargs}
+    flake8 --ignore={[flake8]ignore} {posargs}
 basepython = python2.7
 deps = flake8
        hacking
        flake8-docstrings<0.2.2
+       flake8-putty
        flake8-coding
        flake8-future-import
        flake8-string-format
@@ -39,177 +39,11 @@
 [testenv:flake8-py3]
 commands =
     flake8 --version
-    flake8 --ignore={[params]flake8_ignore} {posargs}
+    flake8 --ignore={[flake8_ignore]ignore} {posargs}
 basepython = python3
 deps = flake8
        flake8-docstrings<0.2.2
-
-[testenv:flake8-docstrings]
-commands = flake8 {posargs}
-deps = flake8>=2.2.5
-       flake8-docstrings<0.2.2
-
-[testenv:flake8-docstrings-mandatory]
-commands = flake8 \
-    docs/conf.py \
-    ez_setup.py \
-    generate_user_files.py \
-    pwb.py \
-    pywikibot/__init__.py \
-    pywikibot/backports.py \
-    pywikibot/bot.py \
-    pywikibot/bot_choice.py \
-    pywikibot/botirc.py \
-    pywikibot/comms/ \
-    pywikibot/compat/ \
-    pywikibot/config2.py \
-    pywikibot/daemonize.py \
-    pywikibot/data/ \
-    pywikibot/date.py \
-    pywikibot/diff.py \
-    pywikibot/echo.py \
-    pywikibot/editor.py \
-    pywikibot/exceptions.py \
-    pywikibot/family.py \
-    pywikibot/flow.py \
-    pywikibot/interwiki_graph.py \
-    pywikibot/families/ \
-    pywikibot/fixes.py \
-    pywikibot/i18n.py \
-    pywikibot/logentries.py \
-    pywikibot/logging.py \
-    pywikibot/login.py \
-    pywikibot/page.py \
-    pywikibot/pagegenerators.py \
-    pywikibot/plural.py \
-    pywikibot/proofreadpage.py \
-    pywikibot/site_detect.py \
-    pywikibot/site.py \
-    pywikibot/textlib.py \
-    pywikibot/throttle.py \
-    pywikibot/titletranslate.py \
-    pywikibot/tools/ \
-    pywikibot/userinterfaces/ \
-    pywikibot/version.py \
-    pywikibot/weblib.py \
-    pywikibot/xmlreader.py \
-    scripts/__init__.py \
-    scripts/add_text.py \
-    scripts/basic.py \
-    scripts/blockpageschecker.py \
-    scripts/blockreview.py \
-    scripts/capitalize_redirects.py \
-    scripts/category.py \
-    scripts/category_redirect.py \
-    scripts/claimit.py \
-    scripts/clean_sandbox.py \
-    scripts/commonscat.py \
-    scripts/coordinate_import.py \
-    scripts/cosmetic_changes.py \
-    scripts/create_categories.py \
-    scripts/data_ingestion.py \
-    scripts/delete.py \
-    scripts/disambredir.py \
-    scripts/djvutext.py \
-    scripts/editarticle.py \
-    scripts/fixing_redirects.py \
-    scripts/flickrripper.py \
-    scripts/harvest_template.py \
-    scripts/illustrate_wikidata.py \
-    scripts/image.py \
-    scripts/imagerecat.py \
-    scripts/imageuncat.py \
-    scripts/listpages.py \
-    scripts/login.py \
-    scripts/maintenance/__init__.py \
-    scripts/maintenance/make_i18n_dict.py \
-    scripts/misspelling.py \
-    scripts/newitem.py \
-    scripts/noreferences.py \
-    scripts/pagefromfile.py \
-    scripts/patrol.py \
-    scripts/piper.py \
-    scripts/protect.py \
-    scripts/replace.py \
-    scripts/selflink.py \
-    scripts/shell.py \
-    scripts/spamremove.py \
-    scripts/states_redirect.py \
-    scripts/template.py \
-    scripts/touch.py \
-    scripts/transferbot.py \
-    scripts/unlink.py \
-    scripts/unusedfiles.py \
-    scripts/upload.py \
-    scripts/version.py \
-    scripts/watchlist.py \
-    setup.py \
-    tests/__init__.py \
-    tests/aspects.py \
-    tests/utils.py \
-    tests/api_tests.py \
-    tests/archivebot_tests.py \
-    tests/basepage_tests.py \
-    tests/bot_tests.py \
-    tests/cache_tests.py \
-    tests/category_tests.py \
-    tests/checkimages_tests.py \
-    tests/cosmetic_changes_tests.py \
-    tests/data/ \
-    tests/data_ingestion_tests.py \
-    tests/date_tests.py \
-    tests/deletionbot_tests.py \
-    tests/disambredir_tests.py \
-    tests/djvu_tests.py \
-    tests/dry_api_tests.py \
-    tests/edit_tests.py \
-    tests/edit_failure_tests.py \
-    tests/exceptions_tests.py \
-    tests/family_tests.py \
-    tests/file_tests.py \
-    tests/flow_edit_tests.py \
-    tests/flow_tests.py \
-    tests/http_tests.py \
-    tests/i18n/ \
-    tests/interwiki_graph_tests.py \
-    tests/interwiki_link_tests.py \
-    tests/l10n_tests.py \
-    tests/link_tests.py \
-    tests/logentry_tests.py \
-    tests/mediawikiversion_tests.py \
-    tests/namespace_tests.py \
-    tests/oauth_tests.py \
-    tests/page_tests.py \
-    tests/paraminfo_tests.py \
-    tests/proofreadpage_tests.py \
-    tests/protectbot_tests.py \
-    tests/pwb/ \
-    tests/pwb_tests.py \
-    tests/python_tests.py \
-    tests/reflinks_tests.py \
-    tests/replacebot_tests.py \
-    tests/script_tests.py \
-    tests/site_detect_tests.py \
-    tests/tests_tests.py \
-    tests/timestamp_tests.py \
-    tests/timestripper_tests.py \
-    tests/thread_tests.py \
-    tests/tk_tests.py \
-    tests/tools_chars_tests.py \
-    tests/tools_ip_tests.py \
-    tests/tools_tests.py \
-    tests/ui_options_tests.py \
-    tests/upload_tests.py \
-    tests/uploadbot_tests.py \
-    tests/weblib_tests.py \
-    tests/weblinkchecker_tests.py \
-    tests/wikibase_edit_tests.py \
-    tests/wikidataquery_tests.py \
-    tests/wikistats_tests.py \
-    tests/xmlreader_tests.py
-
-deps = flake8>=2.2.5
-       flake8-docstrings<0.2.2
+       flake8-putty
 
 [testenv:nose]
 commands =
@@ -249,6 +83,14 @@
 max_line_length = 130
 accept-encodings = utf-8
 require-code = true
+putty-ignore =
+    generate_family_file.py : +D102
+    pywikibot/cosmetic_changes.py : +D102, D103
+    
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
+    
scripts/checkimages.py,scripts/freebasemappingupload.py,scripts/imagetransfer.py,scripts/lonelypages.py,scripts/movepages.py,scripts/nowcommons.py,scripts/redirect.py,scripts/isbn.py,scripts/reflinks.py,scripts/script_wui.py,scripts/templatecount.py,scripts/revertbot.py,scripts/weblinkchecker.py,scripts/welcome.py
 : +D102
+    
scripts/catall.py,scripts/imageharvest.py,scripts/makecat.py,scripts/maintenance/cache.py,scripts/maintenance/wikimedia_sites.py
 : +D103
 
 [pep8]
 ignore = E241,E402,E731

-- 
To view, visit https://gerrit.wikimedia.org/r/255910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id55b466b321357f2a6fc97ef5b93c0fee1f86d03
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jay...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to