bandit icon indicating copy to clipboard operation
bandit copied to clipboard

Allow outputting the report in multiple formats

Open stefanfoulis opened this issue 6 years ago • 6 comments

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.

stefanfoulis avatar Feb 01 '19 21:02 stefanfoulis

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.

ecp4224 avatar Apr 19 '19 14:04 ecp4224

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 :(

sblancov avatar May 14 '21 14:05 sblancov

Any update on this? I could check on the PR that it's almost done! :+1:

mmngreco avatar Aug 12 '21 11:08 mmngreco

Any update? I find this extremely useful

kobiche avatar Sep 13 '22 14:09 kobiche

Any update? I find this extremely useful as well

stijn-techwolf avatar Oct 04 '22 14:10 stijn-techwolf

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.

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.

srgoni avatar Sep 11 '23 06:09 srgoni