tomasbjerre / violation-comments-lib

Library for commenting things with violations from static code analysis.
Apache License 2.0
12 stars 6 forks source link

Wrong Line number being commented #15

Closed AlteaDown closed 4 years ago

AlteaDown commented 4 years ago

I'm noticing for Single File Comments, the wrong line numbers are being commented. I've attached the output with debugging info here: commandOutput.txt

As an example, on LoginScreen.tsx it should comment on line 125 and 163, but it instead comments on line 1.

I've also attached the eslint_report.xml file (in CHECKSTYLE) used for this here (note, it was a .xml before uploading): eslint_report.txt

And an example diff that has the issue:

exampleDiff.txt

tomasbjerre commented 4 years ago

Happens here: https://github.com/tomasbjerre/violation-comments-to-bitbucket-cloud-lib/blob/master/src/main/java/se/bjurr/violations/comments/bitbucketcloud/lib/BitbucketCloudCommentsProvider.java#L69

Which means the lib was unable to parse the diff to find the corresponding line number in the diff. The line number that needs to be used when creating the comment...

I'm not sure it can be done differently, pull requests are welcome.

tomasbjerre commented 4 years ago

Also reported here: https://github.com/tomasbjerre/violation-comments-to-bitbucket-cloud-lib/issues/4