While I find checkov to be great tool, the default output is way too verbose:
In my above example, it dumps all 78 passed checks as well in the terminal output which makes it hard to find the actual errors which need to be fixed. In fact, the output is so verbose, that it starts cutting off a lot of previous outputs which I actually still need to see.
I've embedded this check as one of many terraform checkers in my pre-commit setup like so:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.76.0
hooks:
- id: terraform_checkov
- ...
Filtering the output of checkov --help
for keywords like "verbose" or "CLI", I found these two flags:
❯ checkov --help | grep CLI
--quiet in case of CLI output, display only failed checks.
--compact in case of CLI output, do not display code blocks
In hope this would resolve my problem, I added both of them to the args-section of the pre-commit hook:
- id: terraform_checkov
args: ["--quiet", "--compact"]
Yet, running the pre-commit hook fails:
❯ git add -A && pre-commit run terraform_checkov
Checkov..................................................................Failed step
- hook id: terraform_checkov
- exit code: 1
getopt: unrecognized option '--quiet'
getopt: unrecognized option '--compact'
Therefore, I'm still looking for a possibility to reach exactly especially what the flat --quiet
should do:
I only want to see in the terminal output what went wrong, not what went right.