diff --git a/prospector/tools/mypy/__init__.py b/prospector/tools/mypy/__init__.py index 520c56d0..6ec64edf 100644 --- a/prospector/tools/mypy/__init__.py +++ b/prospector/tools/mypy/__init__.py @@ -29,6 +29,8 @@ def __init__(self, *args, **kwargs): def configure(self, prospector_config, _): options = prospector_config.tool_options('mypy') + + strict = options.get('strict', False) follow_imports = options.get('follow-imports', 'normal') ignore_missing_imports = options.get('ignore-missing-imports', False) @@ -39,6 +41,9 @@ def configure(self, prospector_config, _): strict_optional = options.get('strict-optional', False) self.options.append('--follow-imports=%s' % follow_imports) + + if strict: + self.options.append('--strict') if ignore_missing_imports: self.options.append('--ignore-missing-imports') @@ -71,21 +76,21 @@ def run(self, found_files): for message in report.splitlines(): iter_message = iter(message.split(':')) - (path, line, char, err_type), err_msg = islice(iter_message, 4), list(message) + (path, line, char, err_type, err_msg) = islice(iter_message, 5) location = Location( path=path, module=None, function=None, line=line, - character=char, + character=int(char), absolute_path=True ) message = Message( source='mypy', - code=err_type, + code=err_type.lstrip(" "), location=location, - message=''.join(err_msg).strip() + message=err_msg.lstrip(" ") ) messages.append(message) - return messages \ No newline at end of file + return messages diff --git a/prospector/tools/pylint/linter.py b/prospector/tools/pylint/linter.py index 21f8ea76..4a678902 100644 --- a/prospector/tools/pylint/linter.py +++ b/prospector/tools/pylint/linter.py @@ -20,10 +20,7 @@ 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): - if PYLINT_VERSION >= (2, 0): - self.read_config_file(config_file) - else: - self.read_config_file(config_file, quiet=True) + 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'))