bandit
bandit copied to clipboard
Allow outputting the report in multiple formats
Is your feature request related to a problem? Please describe. In some cases, it is desirable to have the report in multiple different formats.
Describe the solution you'd like Allow outputting the report in multiple formats with just one run.
Describe alternatives you've considered Running the command multiple times for the different report formats can take very long on large codebases.
I have a need for this feature, glancing at the CLI package would simply invoking
b_mgr.output_results(args.context_lines,
sev_level,
conf_level,
args.output_file,
args.output_format,
args.msg_template)
in a for loop, changing the args.output_format
parameter with some form of list that's passed as an argument work? Maybe args.output_format
could always be treated as a comma separated list? That way people currently doing something like -f csv
won't have to change anything, but people also have the option to do -f csv,screen,xml
.
Please, if this works, merge please, it is tremendously useful in CI.
I want to see the log and get HTML reports at the same time.
The horrible workaround is executing this tool twice :(
Any update on this? I could check on the PR that it's almost done! :+1:
Any update? I find this extremely useful
Any update? I find this extremely useful as well
in a for loop, changing the
args.output_format
parameter with some form of list that's passed as an argument work? Maybeargs.output_format
could always be treated as a comma separated list? That way people currently doing something like-f csv
won't have to change anything, but people also have the option to do-f csv,screen,xml
.
That won't be enough, because you'd be overwriting the same file every time.
Other tools work around this by appending a format-specific suffix to the file name, or by accepting a comma-separated list of output file names.
Another way could be to add separate parameters for enabling/disabling logging the report to stdout.