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
Fix sarif output to use 'match.details' in result object, instead of 'match.message' #3163
Conversation
…ad of 'match.message')
Hi, |
Don't worry about that, we add it ourselves. If you using specific semantic branch prefixes like |
Before merging we need to look a little bit at details because AFAIK, some rules might not have details and if true, it might be a regression in UX for these. If that is true, we might need to conditionally fallback to message. |
OK. I stumbled upon this issue while trying to switch from Codeclimate to SARIF output for my IntelliJ plugin; just as you suggested. 😄 Please keep in mind, that at the moment the
The PR attaches the |
Hi there, I just noticed that this PR got marked "incomplete" ("Additional work or information is required"). Is there anything more I can/should provide? Thanks. |
@4ch1m The lack of testing that covers the case where Many rule violations do not have any details (empty string) and this change would negatively impact the outcome for these. For this reason, we need to ensure we test the behavior for both types of violations, those that have details and those that do not have details, ensuring that the proposed change does not create a case where the errors have no text displayed. Probably it would make sense to fallback to message when details values as false. |
That's a good idea; making things bullet-proof. 👍 |
Head branch was pushed to by a user without write access
Hmmmm. 🤔 The CI-setup seems to run into "concurrency issues" with my PR. Still haven't figured what's being done here behind the curtains:
Any quick hint would be much appreciated. Thanks. 🙇 |
for more information, see https://pre-commit.ci
This reverts commit ad8a890.
Nevermind. I just realized this is a general problem with the current codebase. Not related to this PR. |
Hi,
the SARIF output (redundantly) uses the
match.message
for both therule
and theresult
objects:ansible-lint/src/ansiblelint/formatters/__init__.py
Lines 258 to 263 in 4af51fc
ansible-lint/src/ansiblelint/formatters/__init__.py
Lines 278 to 282 in 4af51fc
This isn't correct, since the (general)
rule
object should contain the (general) message/description, whereas theresult
object should provide the detailed description.This would also be in line with the Codeclimate output (see first and last line):
ansible-lint/src/ansiblelint/formatters/__init__.py
Lines 157 to 173 in 4af51fc