Add end line number to lint output #2423
Unanswered
jrobison-sb
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently ansible-lint output exposes a location with a filename and a beginning line number, like this (using json output since that is most concise for this report):
My request is to add an end line number to the output with the line number of the end of the yaml block, like this:
This would be useful in the context of running ansible-lint against a pull request in a CI pipeline. In the above example, if line 378 was being changed in the pull request, then the CI system would have a source of truth to know that the PR it is scanning has introduced a problem. It could then leave a comment on the PR showing the lint failure so the person who proposed the PR can fix it. Here's an example from another open source code scanner of what that could look like: https://github.com/aquasecurity/tfsec-pr-commenter-action/blob/main/images/pr_commenter.png
Or if a person's PR didn't modify lines 376-381, then the CI system could know that this failure is unrelated to the PR being scanned and it can exit silently.
Beta Was this translation helpful? Give feedback.
All reactions