-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Flake8 3.0+ multiple-letter violation codes are not displayed #2163
Comments
See also https://gitlab.com/pycqa/flake8/issues/339 for getting the prefixes guidelines described in the flake8 plugin development guide. |
Please try b01520f. Keep reading you care about the rationale. Vim error types (matched by Vim error numbers (matched by Syntastic recognizes two error types, |
@lcd047 Thanks for getting back. That's definitely a lot better: urls.py|1 col 1 error| __future__ import "generators" missing [FI017]
urls.py|1 col 1 warning| 1 blank line required between summary line and description [D205]
urls.py|4 col 1 warning| Unexpected indentation. [RST301]
urls.py|5 col 1 warning| Block quote ends without a blank line; unexpected unindent. [RST201]
urls.py|7 col 1 warning| Unexpected indentation. [RST301]
urls.py|9 col 1 warning| Block quote ends without a blank line; unexpected unindent. [RST201]
To test that, I modified the plugin to use urls.py|1 col 1 warning| __future__ import "generators" missing [SI017] As I understand it, this let e['type'] = e['type'] =~? '\m^[EFHC]' ? 'E' : 'W' Potentially, numerous plugins could use codes commencing with one of these letters (i.e. Otherwise, I've also tested this with faked 3-letter codes and all seems well: urls.py|36 col 1 warning| Try, Except, Pass detected. [BAN110] |
This was needed when parsing the number with
Yes,
As I said: mapping messages to errors and warnings still needs some work. Trying to handle all possible combinations though is unmaintainable. Thus the decision is based only on the first letter. |
@lcd047 Brilliant, that's working: urls.py|1 col 1 error| __future__ import "generators" missing [FI17]
With that, I believe this issue has been resolved so I'll go ahead and close it. Thanks again. |
Standard format of Flake8 violation codes
Until recently, the standard format was a letter followed by 3 digits, e.g.
E501
.Flake8 3.0+ doesn't enforce 4 character long violation codes
https://gitlab.com/pycqa/flake8/issues/337
Some of the Flake8 plugins using multiple-letter violation codes
Syntastic not displaying multiple-letter violations
Based upon the output of running
flake8
from the command line:Syntastic only displays the following:
urls.py|1 col 1 warning| 1 blank line required between summary line and description [D205]
Attempts to fix
syntax_checkers/python/flake8.vim
Realised the problem was with
errorformat
:But while all of the errors were now being displayed:
The results were unsatisfactory since the codes were incorrect:
F017
was supposed to beFI17
R301
was supposed to beRST301
R201
was supposed to beRST201
Wasn't able to figure out how to pass these through. I had to resort to disabling
errorformat
entirely (no idea what the repercussions of this are):The output isn't perfect but at least it contains all of the required information:
Is it possible to use
errorformat
and output the correct codes?The text was updated successfully, but these errors were encountered: