Skip to content

Infer report-format from report-path extension if no value is provided #1717

@rgmz

Description

@rgmz

Is your feature request related to a problem? Please describe.
If you forget to include the --report-format argument, it defaults to json. This can be confusing if your report file is another format, e.g.:

$ ./gitleaks git . --report-path test.csv

Describe the solution you'd like
If no value is provided for --report-format, check the file extension of report-path and see if it matches a format.

Describe alternatives you've considered
N/A

Additional context
N/A

cc @zricethezav

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions