Skip to content

Commit

Permalink
[fixes #147] Changed file configuration loading to handle new OptionM…
Browse files Browse the repository at this point in the history
…anagerMixin class in Pylint 1.5
  • Loading branch information
carlio committed Dec 7, 2015
1 parent 2612b48 commit 1e60635
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Prospector Changelog
=======

## Version 0.11.1
* [#147](https://github.com/landscapeio/prospector/issues/147) Fixed crash when trying to load pylint configuration files in pylint 1.5

## Version 0.11
* Compatability fixes to work with pylint>=1.5
* McCabe tool now reports correct line and character number for syntax errors (and therefore gets blended if pylint etc detects such an error)
Expand Down
2 changes: 1 addition & 1 deletion prospector/tools/pylint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _prospector_configure(self, prospector_config, linter):
def _pylintrc_configure(self, pylintrc, linter):
with stdout_wrapper(self._hide_stdout):
linter.load_default_plugins()
linter.load_file_configuration(pylintrc)
linter.config_from_file(pylintrc)
if hasattr(linter.config, 'load_plugins'):
linter.load_plugin_modules(linter.config.load_plugins)

Expand Down
7 changes: 7 additions & 0 deletions prospector/tools/pylint/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def __init__(self, found_files, *args, **kwargs):
# set up the standard PyLint linter
PyLinter.__init__(self, *args, **kwargs)

def config_from_file(self, config_file=None):
if PYLINT_VERSION >= (1, 5):
self.read_config_file(config_file)
self.load_config_file()
else:
self.load_file_configuration(config_file)

def reset_options(self):
# for example, we want to re-initialise the OptionsManagerMixin
# to supress the config error warning
Expand Down

0 comments on commit 1e60635

Please sign in to comment.