Output a JSON file that includes the list of files found in LintResult #3678
Unanswered
TamiTakamiya
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
-
Dear ansible-lint team,
ansible-lint internally stores the information about the result of linting in the
LintResult
object.LintResult
has two sections;matches
andfiles
. ansible-lint's various format options (-f {brief,full,md,json,codeclimate,quiet,pep8,sarif}
) work for thematches
section, which contains lint issues found, but there seems no option available to print the information stored in thefiles
section.The
files
section is the list ofLintable
objects, which include valuable information such asrole
,kind
(file types defined in config.py),exc
(exception thrown while processing), etc. We would like utilize such information in our code.The output does not need to contain all information stored in
Lintable
objects, but needs to containthe all files used as the source for the lint run.
Also we want to have the output for
matches
at the same time. If it can be invoked with the--sarif-file
optionand generate two JSON files, it would be ideal.
We wrote a PoC and following is the class we are using for converting a
Lintable
to a serializable object:and an example looks like
I do not think these changes are technically difficult, but there would be some considerations necessary for keeping consistency with existing ansible-lint features, serviceability, etc.
Thank you for reading this to the end!
Beta Was this translation helpful? Give feedback.
All reactions