Skip to content

Proposal: Hook status level report #1777

Description

@j178

The three issues all point to the same problem: per-hook output is useful, but the current reporting is too rigid.

Issue #1240 asks for visibility into hooks skipped by --skip, SKIP, or PREK_SKIP, because those hooks are intentionally excluded and users still want that decision reflected in the run output.

Issue #1468 asks for the opposite in another case: hide (no files to check)Skipped lines because they add noise, especially in large repos and scoped runs.

Issue #1537 generalizes the same concern further: many successful hooks are low-signal and should be hidden unless they fail, while still allowing a fuller view during debugging or CI.

Instead of adding separate flags like --hide-skipped, --show-skipped, or per-hook hiding toggles, add one new prek run flag:

--report-level <level>

Levels, from least to most verbose:

  1. silent
    Show no per-hook status lines.

  2. fail
    Show only failed hooks.

  3. skipped-no-files
    Show failed hooks, plus hooks skipped because there were no files to check.

  4. skipped
    Show failed hooks, plus hooks skipped because there were no files to check, plus hooks skipped by --skip, SKIP, or PREK_SKIP.

  5. passed
    Show failed hooks, skipped hooks, and passed hooks.

  6. all
    Show every hook status and any other report-only states.

Behavior: hook statuses below the selected level are not displayed. Hook execution, exit codes, and failure semantics do not change; this is only an output filter.

This unifies all three requests into one model:

#1240 is covered by --report-level skipped or higher.
#1468 is covered by --report-level fail.
#1537 is covered by --report-level fail for minimal output, or passed when full normal output is desired.

Suggested default: passed, to stay close to current behavior while making the reporting model explicit and extensible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions