Skip to content

Commit

Permalink
Merge 9bafb6b into eb9ee44
Browse files Browse the repository at this point in the history
  • Loading branch information
nasyxx committed Oct 23, 2018
2 parents eb9ee44 + 9bafb6b commit 6e191ca
Showing 1 changed file with 10 additions and 5 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

0 comments on commit 6e191ca

Please sign in to comment.