Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ class Pyflakes(PythonLinter):
'selector': 'source.python'
}

def split_match(self, match):
# mark properly the type error message

error = super().split_match(match)
if not error['match']:
return None

warning_msg_regex = r'''(?x)
\b(?:
used|
unused|
redefines|
shadowed|
(may\sbe)
)\b
'''

warning_msg_regex = re.compile(warning_msg_regex, 0)

if warning_msg_regex.search(error['message']):
error['warning'] = 'warning'
else:
error['error'] = 'error'

return error

def reposition_match(self, line, col, match, vv):
if 'imported but unused' in match.message:
# Consider:
Expand Down