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
Add endColumn/endLine to SARIF region #5011
Conversation
This is great. @chao2zhang do you want to pick this up? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm far from a computer for some days so I can't check. But isn't the psi api give us this information the same way it give us the start? I'm not 100% about this, I couldn't check the code that we have right now.
detekt-report-sarif/src/test/kotlin/io/github/detekt/report/sarif/SarifOutputReportSpec.kt
Outdated
Show resolved
Hide resolved
|
||
every { psiFileMock.text } returns code | ||
every { ktElementMock.containingFile } returns psiFileMock | ||
return ktElementMock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to avoid the usage of mockk here if possible. Could this ktelement created/faked instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
But why is it a bad idea to use mockk
here?
detekt-report-sarif/src/main/kotlin/io/github/detekt/report/sarif/Results.kt
Outdated
Show resolved
Hide resolved
Sorry, could you be more specific? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding tests!
detekt-report-sarif/src/main/kotlin/io/github/detekt/report/sarif/Results.kt
Show resolved
Hide resolved
detekt-report-sarif/src/main/kotlin/io/github/detekt/report/sarif/Results.kt
Show resolved
Hide resolved
detekt-report-sarif/src/test/kotlin/io/github/detekt/report/sarif/SarifOutputReportSpec.kt
Outdated
Show resolved
Hide resolved
detekt-report-sarif/src/test/kotlin/io/github/detekt/report/sarif/SarifOutputReportSpec.kt
Outdated
Show resolved
Hide resolved
Chao answer this already. We need to refactor core to make this more precise. But that's out of scope of this PR. |
@VitalyVPinchuk first of all thank you so much for all the contributions they are really good <3 I want to ask you a favor. In next PRs, if you feel that you are fixing an issue use the ver 'close' or 'fix' before the number or the issue. This way gothub will be automatically close the issue once we merge the PR. This is not a big deal at all but if you can do that it will help a lot so we don't keep already solved issues open :) |
Yes, sure! Thanks for letting me know. |
For #4919
Looks like the following:
But I wasn't able to come up with good tests so I just compare result against predefined text.