Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semgrep hook prints header many times #30

Open
RazerM opened this issue Sep 23, 2024 · 0 comments
Open

semgrep hook prints header many times #30

RazerM opened this issue Sep 23, 2024 · 0 comments

Comments

@RazerM
Copy link

RazerM commented Sep 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant