Skip to content

Commit

Permalink
Hanlding quiet flag in backwards compatible wy
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl committed Jul 22, 2018
1 parent c7f3fc2 commit 13214a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prospector/tools/pylint/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def __init__(self, found_files, *args, **kwargs):
def config_from_file(self, config_file=None):
"""Will return `True` if plugins have been loaded. For pylint>=1.5. Else `False`."""
if PYLINT_VERSION >= (1, 5):
self.read_config_file(config_file)
if PYLINT_VERSION >= (2, 0):
self.read_config_file(config_file, quiet=True)
else:
self.read_config_file(config_file)
if self.cfgfile_parser.has_option('MASTER', 'load-plugins'):
# pylint: disable=protected-access
plugins = _splitstrip(self.cfgfile_parser.get('MASTER', 'load-plugins'))
Expand All @@ -35,7 +38,10 @@ def reset_options(self):
# for example, we want to re-initialise the OptionsManagerMixin
# to supress the config error warning
# pylint: disable=non-parent-init-called
OptionsManagerMixIn.__init__(self, usage=PyLinter.__doc__, quiet=True)
if PYLINT_VERSION >= (2, 0):
OptionsManagerMixIn.__init__(self, usage=PyLinter.__doc__)
else:
OptionsManagerMixIn.__init__(self, usage=PyLinter.__doc__, quiet=True)

def expand_files(self, modules):
expanded = PyLinter.expand_files(self, modules)
Expand Down

0 comments on commit 13214a0

Please sign in to comment.