Skip to content

semgrep hook prints header many times #30

Open
@RazerM

Description

@RazerM

pre-commit runs multiple processes in parallel with a group of files, and since semgrep always outputs a header/title even with --quiet, you get this:

❯ pre-commit run --all-files semgrep
semgrep..................................................................Failed
- hook id: semgrep
- exit code: 1

┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘



┌────────────────┐
│ 1 Code Finding │
└────────────────┘

    src/redacted/redacted.py
   ❯❯❱ redacted
          Some rule description goes here

          305┆ redacted()


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘


┌──── ○○○ ────┐
│ Semgrep CLI │
└─────────────┘

If semgrep does its own multithreading/processing then the hook could use require_serial: true, but I'd still argue the header shouldn't be printed with --quiet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions