Skip to content

Commit

Permalink
Fix regex as the : after the column is optional
Browse files Browse the repository at this point in the history
Fixes SublimeLinter/SublimeLinter#1847
Closes #17

Output from pyflakes can be

```
<stdin>:1044:12 undefined name 'settingss'
<stdin>:34:45: invalid syntax
```

t.i. the `:` after the column is optional.  In the latter case
`filename` overmatched ("not lazy") to "<stdin>:34".
  • Loading branch information
kaste committed May 15, 2022
1 parent 5a09235 commit 3d29ca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Pyflakes(PythonLinter):
cmd = 'pyflakes'
regex = r'''(?x)
^(?P<filename>.+):(?P<line>\d+):((?P<col>\d+):?)?\s
^(?P<filename>.+?):(?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`.
Expand Down

0 comments on commit 3d29ca6

Please sign in to comment.