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

Add an option to make secret scan path honor .gitignore files #801

Closed
agateau-gg opened this issue Nov 17, 2023 · 1 comment
Closed

Add an option to make secret scan path honor .gitignore files #801

agateau-gg opened this issue Nov 17, 2023 · 1 comment
Labels
status:confirmed This issue has been reviewed and confirmed type:feature Feature request

Comments

@agateau-gg
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

ggshield secret scan path does not honor the content of .gitignore files. When running it at the root of a git checkout, this often causes it to scan files it should not scan, since they are not part of the repository content.

Describe the solution you'd like

secret scan path should support a --honor-gitignore or --ignore-vcs option to honor .gitignore files and related files (.git/info/exclude, $HOME/.config/git/ignore).

Regarding naming: --honor-gitignore is more explicit I think, but verbose. --ignore-vcs is used by other tools such as fd and ripgrep.

Additional context

ggshield low-level code already knows how to honor .gitignore files (including .git/info/exclude and $HOME/.config/git/ignore). We "just" need to expose the setting to the CLI.

@agateau-gg agateau-gg added type:feature Feature request status:confirmed This issue has been reviewed and confirmed labels Nov 17, 2023
@agateau-gg agateau-gg changed the title add an option to make secret scan path honor .gitignore files Add an option to make secret scan path honor .gitignore files Nov 17, 2023
@agateau-gg
Copy link
Collaborator Author

This has been implemented and will be in 1.29.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed This issue has been reviewed and confirmed type:feature Feature request
Projects
None yet
Development

No branches or pull requests

1 participant