diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | pylint/test/test_self.py | 12 | ||||
-rw-r--r-- | pylint/utils.py | 8 |
3 files changed, 22 insertions, 0 deletions
@@ -333,6 +333,8 @@ ChangeLog for Pylint This is similar with redundant-keyword-arg, but it's mildly different that it needs to be a separate error. + * --enable=all can now be used. Closes issue #142. + 2015-03-14 -- 1.4.3 diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py index 228c808..ba4cdab 100644 --- a/pylint/test/test_self.py +++ b/pylint/test/test_self.py @@ -247,6 +247,18 @@ class RunTC(unittest.TestCase): expected = "no such option: --load-plugin" self._test_output([".", "--load-plugin"], expected_output=expected) + def test_enable_all_works(self): + module = join(HERE, 'data', 'clientmodule_test.py') + expected = textwrap.dedent(""" + No config file found, using default configuration + ************* Module data.clientmodule_test + W: 10, 8: Unused variable 'local_variable' (unused-variable) + C: 18, 4: Missing method docstring (missing-docstring) + C: 22, 0: Missing class docstring (missing-docstring) + """) + self._test_output([module, "--disable=all", "--enable=all", "-rn"], + expected_output=expected) + if __name__ == '__main__': unittest.main() diff --git a/pylint/utils.py b/pylint/utils.py index 47297b0..3c943fb 100644 --- a/pylint/utils.py +++ b/pylint/utils.py @@ -307,6 +307,14 @@ class MessagesHandlerMixIn(object): def enable(self, msgid, scope='package', line=None, ignore_unknown=False): """reenable message of the given id""" assert scope in ('package', 'module') + if msgid == 'all': + for msgid in MSG_TYPES: + self.enable(msgid, scope=scope, line=line) + if not self._python3_porting_mode: + # Don't activate the python 3 porting checker if it + # wasn't activated explicitly. + self.disable('python3') + return catid = category_id(msgid) # msgid is a category? if catid is not None: |