diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2012-09-20 06:54:35 +0200 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2012-09-20 06:54:35 +0200 |
commit | 18cc2a2b8c8943cf58b36be232b3c5a8219900c5 (patch) | |
tree | 11152fc49a64f3dc8e712bd44a948a7fe7e2ee4a | |
parent | 163c4466948197ee2dfa6eaf2e7d7aa3e34a7cba (diff) | |
download | pylint-git-18cc2a2b8c8943cf58b36be232b3c5a8219900c5.tar.gz |
don't want to run a checker only because of a Fatal error
-rw-r--r-- | lint.py | 3 | ||||
-rw-r--r-- | test/unittest_lint.py | 12 |
2 files changed, 5 insertions, 10 deletions
@@ -496,8 +496,9 @@ This is used by the global evaluation report (RP0004).'}), # get needed checkers neededcheckers = [self] for checker in self.get_checkers()[1:]: + # fatal errors should not trigger enable / disabling a checker messages = set(msg for msg in checker.msgs - if self.is_message_enabled(msg)) + if msg[0] != 'F' and self.is_message_enabled(msg)) if (messages or any(self.report_is_enabled(r[0]) for r in checker.reports)): neededcheckers.append(checker) diff --git a/test/unittest_lint.py b/test/unittest_lint.py index 5b60d4859..533aa94a6 100644 --- a/test/unittest_lint.py +++ b/test/unittest_lint.py @@ -298,17 +298,11 @@ class PyLinterTC(TestCase): def test_disable_alot(self): """check that we disabled a lot of checkers""" self.linter.set_option('reports', False) - # FIXME should it be necessary to explicitly desactivate failures ? self.linter.set_option('disable', 'R,C,W') checker_names = [c.name for c in self.linter.prepare_checkers()] - should_not = ('design', 'metrics', 'similarities') - rest = [name for name in checker_names if name in should_not] - self.assertListEqual(rest, []) - self.linter.set_option('disable', 'R,C,W,F') - checker_names = [c.name for c in self.linter.prepare_checkers()] - should_not += ('format', 'imports') - rest = [name for name in checker_names if name in should_not] - self.assertListEqual(rest, []) + for cname in ('design', 'metrics', 'similarities', + 'imports'): # as a Fatal message that should be ignored + self.assertFalse(cname in checker_names, cname) class ConfigTC(TestCase): |