Skip to content

Commit

Permalink
Also strip message field
Browse files Browse the repository at this point in the history
  • Loading branch information
tomv564 committed Aug 8, 2017
1 parent 62ebafa commit 8c81ffb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyls_mypy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def pyls_lint(document):
# There may be a better solution, but mypy does not provide end
'end': {'line': lineno - 1, 'character': offset + 1}
},
'message': msg,
'message': msg.strip(),

This comment has been minimized.

Copy link
@gatesn

gatesn Aug 8, 2017

Instead of strip everywhere, is the actual separator : ?

Equally, could create a regex pattern to extract the parts of the message

This comment has been minimized.

Copy link
@gatesn

This comment has been minimized.

Copy link
@tomv564

tomv564 Aug 8, 2017

Author Owner

I like the suggestion of using a regex.
Thanks for all the help!

This comment has been minimized.

Copy link
@tomv564

tomv564 Aug 8, 2017

Author Owner

It is now using a regex, I did drop support for lines without columns

'severity': errno
})

Expand Down
2 changes: 1 addition & 1 deletion test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def test_plugin():

assert len(diags) == 1
diag = diags[0]
assert diag['message'] == ' Dict[<nothing>, <nothing>] has no attribute "append"'
assert diag['message'] == 'Dict[<nothing>, <nothing>] has no attribute "append"'
assert diag['range']['start'] == {'line': 0, 'character': 0}
assert diag['range']['end'] == {'line': 0, 'character': 1}

0 comments on commit 8c81ffb

Please sign in to comment.