8000 Reporting: Include explicitly example for writing output as JSON to stdout · Issue #1866 · gitleaks/gitleaks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Reporting: Include explicitly example for writing output as JSON to stdout #1866
Open
@cduggn

Description

@cduggn

Describe the solution you'd like
The Gitleaks report can be written to stdout in JSON format using the predefined StdoutReportPath const, which is a hypen. This doesn't appear to be well known or documented in the current version of the README.

# Outputs JSON format
gitleaks git --no-banner --no-color --log-level=fatal --report-format=json --report-path=-

# Outputs default format
gitleaks git --no-banner --no-color --log-level=fatal --report-format=json

Additional context
The requirement to include --report-path when choosing a --report-format is not mentioned in the docs. Omitting --report-path will not warn the operator but instead fall back to default format.

Proposed change

Add JSON example under "Reporting" section, include a note on dependency between --report-format and report-path , add some additional warning message when user attempts to output in a supported format without supplying path

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

      0