Skip to content
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

Json output format returns an array #588

Closed
ArisBee opened this issue Jul 28, 2022 · 5 comments · Fixed by #619
Closed

Json output format returns an array #588

ArisBee opened this issue Jul 28, 2022 · 5 comments · Fixed by #619
Labels
enhancement The issue is related to improving a certain aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. selected The issue has been selected to be worked on.

Comments

@ArisBee
Copy link

ArisBee commented Jul 28, 2022

That's minor, but when I execute something like:

detect-secrets audit .secrets.baseline --json --report

It will typically returns json objects within an array, for instance if there is no finding it will simply output []. Couldn't it instead return a json object in between curly brackets {}?

@lorenzodb1 lorenzodb1 added the pending The issue still needs to be reviewed by one of the maintainers. label Aug 24, 2022
@jpdakran jpdakran added enhancement The issue is related to improving a certain aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. labels Sep 22, 2022
@jpdakran
Copy link
Member

Hello @ArisBee. Is there a reason you want this enhancement? The functionality of the audit report is to display a list of secret values which is why it returns an empty list.

@ArisBee
Copy link
Author

ArisBee commented Sep 22, 2022

That makes it easier for automated parsing. Now I have to define an exception when nothing is found.

@lorenzodb1
Copy link
Contributor

As I mentioned internally, I fully support this enhancement 😄

@jpdakran
Copy link
Member

@ArisBee Do you want it only in the nothing found case Ex. {}. Or just in general?

@lorenzodb1
Copy link
Contributor

I would add it in general for consistency. Something like

{
    results: [ ... ]
}

@jpdakran jpdakran added selected The issue has been selected to be worked on. and removed pending The issue still needs to be reviewed by one of the maintainers. labels Sep 22, 2022
@jpdakran jpdakran linked a pull request Sep 22, 2022 that will close this issue
jpdakran added a commit that referenced this issue Sep 22, 2022
* Return report result as object instead of list for easier parsing

* Update typing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is related to improving a certain aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. selected The issue has been selected to be worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants