Skip to content

Commit

Permalink
Merge pull request #11 from SublimeLinter/opt-out-stderr-handling
Browse files Browse the repository at this point in the history
Redo error parsing
  • Loading branch information
kaste authored May 11, 2018
2 parents d073c9a + f0a3129 commit 23fa551
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
class Pyflakes(PythonLinter):
cmd = 'pyflakes'
regex = r'''(?x)
.+?:\s* # filename
(?P<line>\d+):\s* # line number
^(?P<filename>[^:\n]+):(?P<line>\d+):((?P<col>\d+):)?\s
# The rest of the line is the error message.
# Within that, capture anything within single quotes as 'near'.
(?P<message>[^\'\n\r]+(?P<near>\'.+?\')?.*)
# The error message may be followed by the offending line of code...
(?:\r?\n.*
# and then another line with a caret (preceded by spaces)
# pointing to the position where the error occurred.
\r?\n(?P<col>[ ]+)\^)?
# Within that, capture anything within single quotes as `near`.
(?P<message>[^\'\n\r]*(?P<near>\'.+?\')?.*)
'''
multiline = True
# stderr has all syntax errors, parse it via our regex
on_stderr = None
defaults = {
'selector': 'source.python'
}

0 comments on commit 23fa551

Please sign in to comment.