summaryrefslogtreecommitdiff
path: root/pylint/lint.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-03-06 18:22:49 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-03-06 18:22:49 +0200
commit1cd7a64ba8921b3650f91e76eeaaf8528b69ff70 (patch)
tree02cbb235af9dedf76e0e60772dbaac70c690fbc3 /pylint/lint.py
parent67a7a7cb2ec9c2682f63864fab15bb45d0a167d1 (diff)
parenta79bec387412da77ab024b35ef1d8579e92d4fff (diff)
downloadpylint-1cd7a64ba8921b3650f91e76eeaaf8528b69ff70.tar.gz
Merged in mibalint/pylint (pull request #234)
#422 [pylint sprint] Create pylintrc and disable checking for all issues
Diffstat (limited to 'pylint/lint.py')
-rw-r--r--pylint/lint.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pylint/lint.py b/pylint/lint.py
index f4c24c6..0c466a1 100644
--- a/pylint/lint.py
+++ b/pylint/lint.py
@@ -456,6 +456,7 @@ class PyLinter(configuration.OptionsManagerMixIn,
self.register_checker(self)
self._dynamic_plugins = set()
self._python3_porting_mode = False
+ self._error_mode = False
self.load_provider_defaults()
if reporter:
self.set_reporter(reporter)
@@ -584,8 +585,16 @@ class PyLinter(configuration.OptionsManagerMixIn,
def error_mode(self):
"""error mode: enable only errors; no reports, no persistent"""
+ self._error_mode = True
self.disable_noerror_messages()
self.disable('miscellaneous')
+ if self._python3_porting_mode:
+ self.disable('all')
+ for msg_id in self._checker_messages('python3'):
+ if msg_id.startswith('E'):
+ self.enable(msg_id)
+ else:
+ self.disable('python3')
self.set_option('reports', False)
self.set_option('persistent', False)
@@ -593,6 +602,15 @@ class PyLinter(configuration.OptionsManagerMixIn,
"""Disable all other checkers and enable Python 3 warnings."""
self.disable('all')
self.enable('python3')
+ if self._error_mode:
+ # The error mode was activated, using the -E flag.
+ # So we'll need to enable only the errors from the
+ # Python 3 porting checker.
+ for msg_id in self._checker_messages('python3'):
+ if msg_id.startswith('E'):
+ self.enable(msg_id)
+ else:
+ self.disable(msg_id)
self._python3_porting_mode = True
# block level option handling #############################################