diff options
| -rw-r--r-- | coverage/backward.py | 4 | ||||
| -rw-r--r-- | coverage/collector.py | 2 | ||||
| -rw-r--r-- | coverage/control.py | 5 | ||||
| -rw-r--r-- | coverage/monkey.py | 2 | ||||
| -rw-r--r-- | coverage/parser.py | 1 | ||||
| -rw-r--r-- | pylintrc | 25 | ||||
| -rw-r--r-- | requirements/dev.pip | 2 | ||||
| -rw-r--r-- | tests/test_api.py | 6 | ||||
| -rw-r--r-- | tests/test_html.py | 12 | ||||
| -rw-r--r-- | tests/test_process.py | 4 | ||||
| -rw-r--r-- | tests/test_summary.py | 13 | 
11 files changed, 35 insertions, 41 deletions
diff --git a/coverage/backward.py b/coverage/backward.py index 50d49a0f..700c3ebd 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -6,7 +6,7 @@  # This file does lots of tricky stuff, so disable a bunch of pylint warnings.  # pylint: disable=redefined-builtin  # pylint: disable=unused-import -# pylint: disable=no-name-in-module +# pxlint: disable=no-name-in-module  import sys @@ -47,7 +47,7 @@ except ImportError:  try:      range = xrange  except NameError: -    range = range +    range = range       # pylint: disable=redefined-variable-type  # shlex.quote is new, but there's an undocumented implementation in "pipes",  # who knew!? diff --git a/coverage/collector.py b/coverage/collector.py index a296b227..5668877b 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -17,7 +17,7 @@ os = isolate_module(os)  try:      # Use the C extension code when we can, for speed. -    from coverage.tracer import CTracer, CFileDisposition   # pylint: disable=no-name-in-module +    from coverage.tracer import CTracer, CFileDisposition  except ImportError:      # Couldn't import the C extension, maybe it isn't built.      if os.getenv('COVERAGE_TEST_TRACER') == 'c': diff --git a/coverage/control.py b/coverage/control.py index f350b3d1..9bd0def1 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -123,6 +123,7 @@ class Coverage(object):          # 2: from the rcfile, .coveragerc or setup.cfg file:          if config_file: +            # pylint: disable=redefined-variable-type              did_read_rc = False              # Some API users were specifying ".coveragerc" to mean the same as              # True, so make it so. @@ -322,7 +323,8 @@ class Coverage(object):              # When testing, we use PyContracts, which should be considered              # part of coverage.py, and it uses six. Exclude those directories              # just as we exclude ourselves. -            import contracts, six +            import contracts +            import six              for mod in [contracts, six]:                  self.cover_dirs.append(self._canonical_dir(mod)) @@ -921,6 +923,7 @@ class Coverage(object):                  )          if file_reporter == "python": +            # pylint: disable=redefined-variable-type              file_reporter = PythonFileReporter(morf, self)          return file_reporter diff --git a/coverage/monkey.py b/coverage/monkey.py index e7517bf6..d0bdf009 100644 --- a/coverage/monkey.py +++ b/coverage/monkey.py @@ -64,7 +64,7 @@ def patch_multiprocessing():      # re-applies the monkey-patch.      # Windows only spawns, so this is needed to keep Windows working.      try: -        from multiprocessing import spawn           # pylint: disable=no-name-in-module +        from multiprocessing import spawn          original_get_preparation_data = spawn.get_preparation_data      except (ImportError, AttributeError):          pass diff --git a/coverage/parser.py b/coverage/parser.py index 8fb5d89b..c3dba830 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -106,6 +106,7 @@ class PythonParser(object):          """          combined = join_regex(regexes)          if env.PY2: +            # pylint: disable=redefined-variable-type              combined = combined.decode("utf8")          regex_c = re.compile(combined)          matches = set() @@ -18,9 +18,6 @@  # pygtk.require().  #init-hook= -# Profiled execution. -profile=no -  # Add <file or directory> to the black list. It should be a base name, not a  # path. You may set this option multiple times.  ignore= @@ -69,8 +66,13 @@ disable=  # Messages that may be silly:      no-self-use,      no-member, -# formatting stuff +    using-constant-test, +    too-many-nested-blocks, +# Formatting stuff      superfluous-parens,bad-continuation, +# I'm fine deciding my own import order, +    wrong-import-position, +    wrong-import-order,  # Messages that are noisy for now, eventually maybe we'll turn them on:      invalid-name,      protected-access, @@ -100,10 +102,6 @@ reports=no  # (R0004).  evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) -# Add a comment according to your evaluation note. This is used by the global -# evaluation report (R0004). -comment=no -  # Enable the report(s) with the given id(s).  #enable-report= @@ -123,9 +121,6 @@ comment=no  #   [BASIC] -# Required attributes for module, separated by a comma -required-attributes= -  # Regular expression which should only match functions or classes name which do  # not require a docstring  # Special methods don't: __foo__ @@ -184,10 +179,6 @@ ignore-mixin-members=yes  # (useful for classes with attributes dynamicaly set).  ignored-classes=SQLObject -# When zope mode is activated, consider the acquired-members option to ignore -# access to some undefined attributes. -zope=no -  # List of members which are usually get through zope's acquisition mecanism and  # so shouldn't trigger E0201 when accessed (need zope=yes to be considered).  acquired-members=REQUEST,acl_users,aq_parent @@ -222,10 +213,6 @@ additional-builtins=  #   [CLASSES] -# List of interface methods to ignore, separated by a comma. This is used for -# instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by -  # List of method names used to declare (i.e. assign) instance attributes.  defining-attr-methods=__init__,__new__,setUp,reset diff --git a/requirements/dev.pip b/requirements/dev.pip index cb2fa776..df068693 100644 --- a/requirements/dev.pip +++ b/requirements/dev.pip @@ -13,7 +13,7 @@ greenlet==0.4.9  mock==2.0.0  PyContracts==1.7.9  pyenchant==1.6.6 -pylint==1.4.5 +pylint==1.5.6  unittest-mixins==1.0  # for kitting. diff --git a/tests/test_api.py b/tests/test_api.py index 4ee99a1b..27092098 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -429,7 +429,7 @@ class SourceOmitIncludeTest(OmitIncludeTestsMixin, CoverageTest):          """          cov = coverage.Coverage(**kwargs)          cov.start() -        import usepkgs  # pragma: nested   # pylint: disable=import-error,unused-variable +        import usepkgs  # pragma: nested   # pylint: disable=import-error          cov.stop()      # pragma: nested          data = cov.get_data()          summary = data.line_counts() @@ -468,7 +468,7 @@ class ReportIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest):          """Try coverage.report()."""          cov = coverage.Coverage()          cov.start() -        import usepkgs  # pragma: nested   # pylint: disable=import-error,unused-variable +        import usepkgs  # pragma: nested   # pylint: disable=import-error          cov.stop()      # pragma: nested          report = StringIO()          cov.report(file=report, **kwargs) @@ -487,7 +487,7 @@ class XmlIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest):          """Try coverage.xml_report()."""          cov = coverage.Coverage()          cov.start() -        import usepkgs  # pragma: nested   # pylint: disable=import-error,unused-variable +        import usepkgs  # pragma: nested   # pylint: disable=import-error          cov.stop()      # pragma: nested          cov.xml_report(outfile="-", **kwargs)          return self.stdout() diff --git a/tests/test_html.py b/tests/test_html.py index e16bf879..dda2e4b6 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -597,7 +597,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/omit_1")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              cov = coverage.Coverage(include=["./*"])              cov.start()              import main         # pragma: nested @@ -610,7 +610,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/omit_2")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              cov = coverage.Coverage(include=["./*"])              cov.start()              import main         # pragma: nested @@ -623,7 +623,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/omit_3")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              cov = coverage.Coverage(include=["./*"])              cov.start()              import main         # pragma: nested @@ -636,7 +636,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/omit_4")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              cov = coverage.Coverage(config_file="omit4.ini", include=["./*"])              cov.start()              import main         # pragma: nested @@ -649,7 +649,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/omit_5")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              cov = coverage.Coverage(config_file="omit5.ini", include=["./*"])              cov.start()              import main         # pragma: nested @@ -662,7 +662,7 @@ class HtmlGoldTests(CoverageGoldTest):          self.output_dir("out/other")          with change_dir("src"): -            # pylint: disable=import-error, unused-variable +            # pylint: disable=import-error              sys.path.insert(0, "../othersrc")              cov = coverage.Coverage(include=["./*", "../othersrc/*"])              cov.start() diff --git a/tests/test_process.py b/tests/test_process.py index 701edecf..5298b722 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -945,6 +945,7 @@ class UnicodeFilePathsTest(CoverageTest):          )          if env.PY2: +            # pylint: disable=redefined-variable-type              report_expected = report_expected.encode(output_encoding())          out = self.run_command("coverage report") @@ -983,6 +984,7 @@ class UnicodeFilePathsTest(CoverageTest):          )          if env.PY2: +            # pylint: disable=redefined-variable-type              report_expected = report_expected.encode(output_encoding())          out = self.run_command("coverage report") @@ -1053,7 +1055,7 @@ class ProcessStartupTest(ProcessCoverageMixin, CoverageTest):              data_file = .mycovdata              """)          self.set_environ("COVERAGE_PROCESS_START", "coverage.ini") -        import main             # pylint: disable=import-error,unused-variable +        import main             # pylint: disable=import-error          with open("out.txt") as f:              self.assertEqual(f.read(), "Hello, world!\n") diff --git a/tests/test_summary.py b/tests/test_summary.py index c94c2ba1..c8abd7d8 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -420,6 +420,7 @@ class SummaryTest(CoverageTest):              u"Couldn't parse 'accented\xe2.py' as Python source: 'error' at line 1"          )          if env.PY2: +            # pylint: disable=redefined-variable-type              expected = expected.encode(output_encoding())          self.assertEqual(last, expected) @@ -477,7 +478,7 @@ class SummaryTest(CoverageTest):              """)          cov = coverage.Coverage(branch=True, source=["."])          cov.start() -        import main     # pragma: nested # pylint: disable=import-error,unused-variable +        import main     # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          report = self.get_report(cov).splitlines()          self.assertIn("mybranch.py 5 5 2 0 0%", report) @@ -486,7 +487,7 @@ class SummaryTest(CoverageTest):          """A helper for the next few tests."""          cov = coverage.Coverage()          cov.start() -        import TheCode  # pragma: nested # pylint: disable=import-error,unused-variable +        import TheCode  # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          return self.get_report(cov) @@ -521,7 +522,7 @@ class SummaryTest(CoverageTest):              """)          cov = coverage.Coverage()          cov.start() -        import start    # pragma: nested # pylint: disable=import-error,unused-variable +        import start    # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          report = self.get_report(cov) @@ -541,7 +542,7 @@ class SummaryTest(CoverageTest):          # Run the program.          cov = coverage.Coverage()          cov.start() -        import main     # pragma: nested # pylint: disable=import-error,unused-variable +        import main     # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          report = self.get_report(cov).splitlines() @@ -571,7 +572,7 @@ class SummaryTest(CoverageTest):          # Run the program.          cov = coverage.Coverage()          cov.start() -        import main     # pragma: nested # pylint: disable=import-error,unused-variable +        import main     # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          # Put back the missing Python file. @@ -599,7 +600,7 @@ class SummaryTest2(CoverageTest):          # statements, not one statement.          cov = coverage.Coverage(branch=True)          cov.start() -        import usepkgs  # pragma: nested # pylint: disable=import-error,unused-variable +        import usepkgs  # pragma: nested # pylint: disable=import-error          cov.stop()      # pragma: nested          repout = StringIO()  | 
