diff --git a/linter.py b/linter.py index bf80aa3..24d9049 100644 --- a/linter.py +++ b/linter.py @@ -4,21 +4,15 @@ class Pyflakes(PythonLinter): cmd = 'pyflakes' regex = r'''(?x) - .+?:\s* # filename - (?P\d+):\s* # line number + ^(?P[^:\n]+):(?P\d+):((?P\d+):)?\s # The rest of the line is the error message. - # Within that, capture anything within single quotes as 'near'. - (?P[^\'\n\r]+(?P\'.+?\')?.*) - - # 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[ ]+)\^)? + # Within that, capture anything within single quotes as `near`. + (?P[^\'\n\r]*(?P\'.+?\')?.*) ''' multiline = True + # stderr has all syntax errors, parse it via our regex + on_stderr = None defaults = { 'selector': 'source.python' }