-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
include prohibited regular expressions from a .gitprohibited file #163
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,6 +403,9 @@ like Ubuntu (BSD vs GNU). | |
You can add prohibited regular expression patterns to your git config using | ||
``git secrets --add <pattern>``. | ||
|
||
You can also add prohibited regular expressions patterns to a | ||
``.gitprohibited`` file located in the repository's root directory. Lines starting | ||
with ``#`` are skipped (comment line) and empty lines are also skipped. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How should the user specify patterns that start with |
||
|
||
Ignoring false positives | ||
------------------------ | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -47,6 +47,10 @@ prepare_commit_msg_hook* prepare-commit-msg hook (internal only)" | |||||
|
||||||
load_patterns() { | ||||||
git config --get-all secrets.patterns | ||||||
local gitprohibited="$(git rev-parse --show-toplevel)/.gitprohibited" | ||||||
if [ -e "$gitprohibited" ]; then | ||||||
cat $gitprohibited | awk 'NF && $1!~/^#/' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fi | ||||||
# Execute each provider and use their output to build up patterns | ||||||
git config --get-all secrets.providers | while read -r cmd; do | ||||||
# Only split words on '\n\t ' and strip "\r" from the output to account | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sold on the name, but can't think of a better one. I'm opening this thread to explicitly ask the next reviewer to weigh in on the file name.