diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-09-01 21:41:10 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-09-01 21:41:10 +0300 |
commit | 7d9d8365065376461c588162afa6b0c495d8353c (patch) | |
tree | 9a03a50b519c8c246b9fa1ba6008493a9f00d678 /pylint/lint.py | |
parent | 19161ddc41707337b3be5778ea2e01504f23ece0 (diff) | |
download | pylint-7d9d8365065376461c588162afa6b0c495d8353c.tar.gz |
Bring parts of logilab.common.configuration and logilab.common.optik_ext into pylint.config
The reason behind this is that we can better control the behaviour
of the underlying configuration modules, such as the case for undefined
options or for quickly fixing other bugs. Another side effect of this
change is that it gets us closer to the moment where we will not
be dependent on logilab.common anymore, which will definitely
make our pytest users happy.
Some parts were copied almost verbatim from logilab.common.configuration
and logilab.common.optik_ext and pylint.config will definitely need
a refactoring and reengineering for abstracting the configuration,
so that we won't use optparse anymore, but that's subject for another
patch.
Diffstat (limited to 'pylint/lint.py')
-rw-r--r-- | pylint/lint.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pylint/lint.py b/pylint/lint.py index 5fd3d10..0bc3234 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -42,7 +42,6 @@ import warnings import astroid from astroid.__pkginfo__ import version as astroid_version from astroid import modutils -from logilab.common import configuration from logilab.common import ureports import six @@ -245,7 +244,7 @@ if multiprocessing is not None: msgs, linter.stats, linter.msg_status) -class PyLinter(configuration.OptionsManagerMixIn, +class PyLinter(config.OptionsManagerMixIn, utils.MessagesHandlerMixIn, utils.ReportsHandlerMixIn, checkers.BaseTokenChecker): @@ -442,12 +441,12 @@ class PyLinter(configuration.OptionsManagerMixIn, 'enable-msg': self.enable} full_version = '%%prog %s, \nastroid %s\nPython %s' % ( version, astroid_version, sys.version) - configuration.OptionsManagerMixIn.__init__( - self, usage=__doc__, - version=full_version, - config_file=pylintrc or config.PYLINTRC) utils.MessagesHandlerMixIn.__init__(self) utils.ReportsHandlerMixIn.__init__(self) + super(PyLinter, self).__init__( + usage=__doc__, + version=full_version, + config_file=pylintrc or config.PYLINTRC) checkers.BaseTokenChecker.__init__(self) # provided reports self.reports = (('RP0001', 'Messages by category', @@ -504,7 +503,7 @@ class PyLinter(configuration.OptionsManagerMixIn, reporter.linter = self def set_option(self, optname, value, action=None, optdict=None): - """overridden from configuration.OptionsProviderMixin to handle some + """overridden from config.OptionsProviderMixin to handle some special options """ if optname in self._options_methods or \ @@ -534,7 +533,7 @@ class PyLinter(configuration.OptionsManagerMixIn, try: checkers.BaseTokenChecker.set_option(self, optname, value, action, optdict) - except configuration.UnsupportedAction: + except config.UnsupportedAction: print('option %s can\'t be read from config file' % \ optname, file=sys.stderr) @@ -746,7 +745,7 @@ class PyLinter(configuration.OptionsManagerMixIn, for opt_providers in six.itervalues(self._all_options): for optname, optdict, val in opt_providers.options_and_values(): if optname not in filter_options: - child_config[optname] = configuration.format_option_value( + child_config[optname] = utils._format_option_value( optdict, val) child_config['python3_porting_mode'] = self._python3_porting_mode child_config['plugins'] = self._dynamic_plugins |