1. Kevin Qiu
  2. pylint


Anthony VEREZ  committed 21a4414

fix R0801 similarities bug. Closes #63424

  • Participants
  • Parent commits 241f04d
  • Branches default

Comments (0)

Files changed (4)

File ChangeLog

View file
     * #103656: fix W0231 false positive for missing call to object.__init__
       (patch by lothiraldan@gmail.com)
+    * #63424: fix similarity report disabling by properly renaming it to RP0801
     * #103949: create a console_scripts entry point to be used by
       easy_install, buildout and pip
     * stop including tests files in distribution, they causes crash when
       installed with python3 (#72022, #82417, #76910)
 2012-07-17  --  0.25.2
     * #93591: Correctly emit warnings about clobbered variable names when an
       except handler contains a tuple of names instead of a single name.
     * fix potential crashes with utils.safe_infer raising InferenceError
 2011-12-08  --  0.25.1
     * #81078: Warn if names in  exception handlers clobber overwrite
       existing names (patch by tmarek@google.com)

File checkers/similar.py

View file
     # reports
-    reports = ( ('R0801', 'Duplication', report_similarities), ) # XXX actually a Refactoring message
+    reports = ( ('RP0801', 'Duplication', report_similarities), )
     def __init__(self, linter=None):
         BaseChecker.__init__(self, linter)

File doc/features.txt

View file
-:R0801: Duplication
+:RP0801: Duplication
 string_format checker

File test/unittest_lint.py

View file
-# Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
 # This program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free Software
 # Foundation; either version 2 of the License, or (at your option) any later
         self.assertFalse(any(name in checker_names for name in should_not))
     def test_disable_similar(self):
-        # XXX we have to disable them both, that's no good
-        self.linter.set_option('reports', False)
+        self.linter.set_option('disable', 'RP0801')
         self.linter.set_option('disable', 'R0801')
         self.assertFalse('similarities' in [c.name for c in self.linter.prepare_checkers()])