Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
chocoelho committed Nov 17, 2018
2 parents 94a8475 + 6724905 commit cde303b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 10 additions & 5 deletions prospector/tools/mypy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')
Expand Down Expand Up @@ -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
return messages
5 changes: 1 addition & 4 deletions prospector/tools/pylint/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit cde303b

Please sign in to comment.