support older flake8 output, still used by hacking module from openstack style guide #2215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hacking module link: https://github.com/openstack-dev/hacking
They install specific version of flake8 with some other plugins.
Our internal style guide uses hacking, which is based on older flake8. The output changed slightly, and the difference is whether there is a ':' after the error code. So I merely add ':?' to the pattern here to make it work with new flake8 or older version.
I added the test for it, and here's the vader output. As you can see, my new test (the last one on the list) works and I haven't screwed the other ones. So yay!
Starting Vader: 1 suite(s), 11 case(s)
Starting Vader: D:\github\ale\test\handler\test_flake8_handler.vader
( 1/11) [EXECUTE] The flake8 handler should handle basic warnings and syntax errors
( 2/11) [EXECUTE] The flake8 handler should set end column indexes for certain errors
( 3/11) [EXECUTE] The flake8 handler should handle stack traces
( 4/11) [EXECUTE] The flake8 handler should handle names with spaces
( 5/11) [EXECUTE] Warnings about trailing whitespace should be reported by default
( 6/11) [EXECUTE] Disabling trailing whitespace warnings should work
( 7/11) [EXECUTE] Warnings about trailing blank lines should be reported by default
( 8/11) [EXECUTE] Disabling trailing blank line warnings should work
( 9/11) [EXECUTE] F401 should be a warning
(10/11) [EXECUTE] E112 should be a syntax error
(11/11) [EXECUTE] Compatibility with hacking which uses older style flake8
Success/Total: 11/11
Success/Total: 11/11 (assertions: 11/11)
Elapsed time: 0.407332 sec.
Thanks for this plugin! It's been boosting my productivity!