Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

eugeneduetto
Copy link
Contributor

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.

Copy link
Collaborator

@jparise jparise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I also verified that this continues to work when the column offset isn't given, too.

@jparise jparise merged commit c4e0360 into pinterest:master Dec 18, 2018
@eugeneduetto
Copy link
Contributor Author

No problem! Thanks for the fast turnaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants