Support `--json` mode
See original GitHub issueI’ve just stumbled upon this package and have to say: it seems super cool!
My company has an internal auditor that runs the appropriate auditors against our repos, and this looks like it could be a complete drop-in that would gain us some very useful features (whitelisting in particular).
However currently audit-ci
outputs a few lines of text before & after the JSON audit results - it would be useful if there was a --json
flag that would have only the audit results JSON be outputted.
An extension on this could be to then add a auditCi
property that contained information from audit-ci
, such as what was whitelisted.
I’m happy to work on a PR for this, and have a few ideas on how to go about it - my initial attempt will likely be to just replace all log calls with a logger function call that is a noop if the flag is present.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
I have not performed any work on this feature at this time. However, I do think it is a valuable addition. I don’t have immediate plans to write this feature myself (may in the future), but I would certainly review PR requests.
For further flexibility, I would consider revising the flag from
--json
to something like--output {none/full/json} (default full)
. This is slightly different than the--report-type
since report-type refers to the output within either afull
orjson
.I am unsure if this would be a confusing semantic for adopters. Also, since Yarn uses JSON-lines format rather than JSON, that might result in a “gotcha”, but this behaviour can be documented.
EDIT: I am not sure if
--output none
would ever be the desired behaviour. I made that up on the spot and have never had a request for it.