Conversation
# Conflicts: # reporting/report.go
# Conflicts: # cmd/main.go
# Conflicts: # cmd/main.go
| cobra.OnInitialize(initLog) | ||
| rootCmd.PersistentFlags().StringSlice(tagsFlagName, []string{"all"}, "select rules to be applied") | ||
| rootCmd.PersistentFlags().String(logLevelFlagName, "info", "log level (trace, debug, info, warn, error, fatal)") | ||
| rootCmd.PersistentFlags().StringSlice(reportPath, []string{""}, "path to generate report file. Available formats are: json, yaml and sarif") |
There was a problem hiding this comment.
| rootCmd.PersistentFlags().StringSlice(reportPath, []string{""}, "path to generate report file. Available formats are: json, yaml and sarif") | |
| rootCmd.PersistentFlags().StringSlice(reportPath, []string{""}, "path to generate report files. The output format will be determined by the file extension (.json, .yaml, .sarif)") |
There was a problem hiding this comment.
https://github.com/spf13/cobra/blob/main/shell_completions.md#completions-for-flags
| rootCmd.PersistentFlags().StringSlice(reportPath, []string{""}, "path to generate report file. Available formats are: json, yaml and sarif") | |
| rootCmd.PersistentFlags().StringSlice(reportPath, []string{""}, "path to generate report file. Available formats are: json, yaml and sarif") | |
| rootCmd.MarkPersistentFlagFilename(reportPath, "json", "yaml", "sarif") | |
| rootCmd.PersistentFlags().String(stdoutFormat, "yaml", "stdout output format, available formats are: json, yaml and sarif") |
There was a problem hiding this comment.
none of them should be mandatory, isn't that what we agreed? Report File is only if the user wants a report and the stdoutFormat has the default value set to yaml so it will print yaml by default like we talked about
There was a problem hiding this comment.
What you say is it will always print to the stdout (because you can't omit it, if so, it will be yaml as default)?
OK then, let's keep it like that.
But please consider my first suggestion, I think we need to explain that the format will be decided by the file extension,
There was a problem hiding this comment.
What you say is it will always print to the
stdout(because you can't omit it, if so, it will beyamlas default)?
exactly this
But please consider my first suggestion, I think we need to explain that the format will be decided by the file extension
I did consider it and changed it, but in this view it always stays as it was it doesn't show the updates.
Please check here that it is what you suggested:
https://github.com/Checkmarx/2ms/pull/71/files#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6
There was a problem hiding this comment.
I'm not sure why we need this file. Do you expect it to grow?
There was a problem hiding this comment.
I needed to pass the version, so instead of doing it by argument I did it like this as I do expect it to grow in the future
There was a problem hiding this comment.
Maybe call it "Properties" or another term from SARIF?
Because I don't think it is used for configuration details (such as environment variables and feature flags).
baruchiro
left a comment
There was a problem hiding this comment.
Thank you, please re-review the unresolved comments.
Approved.








No description provided.