Repository navigation
[report-converter] Read the column from Pyflakes output - #5222
Open
ranjithguggilla wants to merge 1 commit into
Open
ranjithguggilla wants to merge 1 commit into
ranjithguggilla wants to merge 1 commit into
Conversation
Pyflakes prints the column number after the line number since version
2.2.0 ("file:line:col message"), and with a colon since 2.5.0
("file:line:col: message"). The parser only knew the older
"file:line: message" format, so for current Pyflakes every report got
column 0 and a message that starts with the column number, for example
"12: undefined name 'self'".
Match an optional column after the line number and use it when present.
Output without a column is parsed as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pyflakes has printed a column after the line number since 2.2.0. Releases 2.2.0 through 2.4.0 write
file:line:col message, and 2.5.0 and later writefile:line:col: message. The report-converter parser only matched the olderfile:line: messageform, so with any Pyflakes from the last six years every report was stored at column 0 and the column number was left on the front of the message:The parser now accepts an optional column after the line number and uses it when it is present. Output that has no column is parsed exactly as before, so those reports keep the same column, message, and hash.
Regression tests use real output of both column formats (pyflakes 4.1.0 and pyflakes 2.4.0) for the existing
files/simple.pyfixture, and they share one expected plist. The existing column-lesssimple.outcase is unchanged.Pyflakes reports already stored from current Pyflakes will get new report IDs once the column and message are correct. The report hash includes both fields, so a stored report from new-format output shows up once as resolved and once as new. Output without a column keeps its report IDs.
Local checks on Python 3.11, with the pinned dev tools (pytest 7.3.1, pycodestyle 2.12.0, pylint 3.2.7):
make test_unitis 133 passed; the same fiveplist_to_htmltests fail becausemake depwas not run andcodemirror.LICENSEis missing