Skip to content

.secretsignore without [secrets] isn’t used #60

@adamchainz

Description

@adamchainz

Say my .secretsignore should ignore everything:

$ cat .secretsignore
*

It doesn't unfortunately work:

$ pre-commit run ripsecrets --all-files --verbose
Found existing alias for "pre-commit run". You should use: "prcr"
ripsecrets...............................................................Failed
- hook id: ripsecrets
- duration: 0.01s
- exit code: 1

credentials.toml:3:password = 'uJSU7Kxquv5FXDRLF7SCBaksmo9o2Zp8'

Adding an empty [secrets] section makes it work though:

$ echo "[secrets]" >> .secretsignore

$ pre-commit run ripsecrets --all-files --verbose
Found existing alias for "pre-commit run". You should use: "prcr"
ripsecrets...............................................................Passed
- hook id: ripsecrets
- duration: 0.01s

This seems to be due to missed creation of the Gitignore object in one branch in https://github.com/sirwart/ripsecrets/blob/main/src/ignore_info.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions