beeware/beefore

Javacheckstyle check not parsing line numbers correctly

cflee opened this issue · 0 comments

cflee commented

Per beeware/voc#640, it seems that checkstyle errors may not be picked up correctly by javacheckstyle.py due to the regex used to parse the checkstyle output.

I was just running ant checkstyle locally and I saw two slight variants of error outputs, the latter with no column number:

[checkstyle] [ERROR] /Users/cflee/Projects/voc-dev/voc/python/common/org/python/types/Bytes.java:1237:18: '{' is not preceded with whitespace. [WhitespaceAround]
[checkstyle] [ERROR] /Users/cflee/Projects/voc-dev/voc/python/common/org/python/types/Str.java:1: File length is 2,374 lines (max allowed is 2,000). [FileLength]

Feeding these lines (separately) into https://pythex.org with LINT_OUTPUT, the line number captured is 18 for the former instead of 1237. This seems like it will cause the checkstyle error to get ignored, as line 18 didn't change, so it doesn't exist in the diff.

The current LINT_OUTPUT captures the line number 1 correctly for the latter, so I'm just including it to make sure both output cases are handled in the fix. But it is less important, since even if parsed correctly, any non-line-1 change that triggers a file-level error (and listed as line 1 by checkstyle) will get ignored by the same heuristic.