summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2012-09-20 06:54:35 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2012-09-20 06:54:35 +0200
commit18cc2a2b8c8943cf58b36be232b3c5a8219900c5 (patch)
tree11152fc49a64f3dc8e712bd44a948a7fe7e2ee4a
parent163c4466948197ee2dfa6eaf2e7d7aa3e34a7cba (diff)
downloadpylint-git-18cc2a2b8c8943cf58b36be232b3c5a8219900c5.tar.gz
don't want to run a checker only because of a Fatal error
-rw-r--r--lint.py3
-rw-r--r--test/unittest_lint.py12
2 files changed, 5 insertions, 10 deletions
diff --git a/lint.py b/lint.py
index b3acd25c0..af9d18ac0 100644
--- a/lint.py
+++ b/lint.py
@@ -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):