Skip to content
Discussion options

You must be logged in to vote

The args line is a separate list item instead of being nested under the id: gitleaks hook, which is why pre-commit sees it as its own hook entry missing a required id. Each - under hooks: is one hook config, so args needs to be indented under the same entry as id: gitleaks, not as a sibling:

repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.26.0
    hooks:
      - id: gitleaks
        args: [--config=.gitleaks.toml]

Your version parses as two separate hook entries — {id: gitleaks} and {args: [...]} — and the second one fails validation because it has no id.

Also worth knowing: if .gitleaks.toml sits at the root of the repo being scanned, you don't actually need --config at…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pantelis-karamolegkos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants