pinterest / arcanist-linters

A collection of custom Arcanist linters
Apache License 2.0
63 stars 45 forks source link

Update Checkstyle regex to correctly parse line & char values from output #16

Closed eugeneduetto closed 5 years ago

eugeneduetto commented 5 years ago

When trying out the Checkstyle linter, I noticed that we sometimes weren't parsing out the correct line and character values. This then would cause the ArcanistLintMessage to point to the wrong spot in the code.

For example, using the following example output:

[WARN] /some/path/to/file.java:49:8: Unused import - com.some.package.Class. [UnusedImports]

The existing regex would incorrectly believe path was /some/path/to/file.java:49 and the line number was 8. With the proposed pull request of making the regex lazy for the path grouping, we will then correctly have path be /some/path/to/file.java, line number be 49, and character be 8.

The canonical output of [WARN] /some/path.java:123: Some message [etc] is still parsed correctly.

eugeneduetto commented 5 years ago

No problem! Thanks for the fast turnaround.