forked from catalyst-cloud/catalystcloud-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
executable file
·30 lines (22 loc) · 753 Bytes
/
pre-commit
File metadata and controls
executable file
·30 lines (22 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
echo -e "\n#######################"
echo -e "Running pre-commit hook"
echo -e "#######################"
IFS="
"
echo -e "\nChecking for un-anonymised UUID values\n"
matches=$(grep -rn --exclude={*png,*jpg} --exclude-dir={build,venv,src,.idea} \
-E "\b[a-z0-9]{32}\b|\b\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\b" | grep -vi xxx)
if [ -n "$matches" ]; then
echo "The following were identified as possible un-anonymised UUID values."
echo -e "Please correct these and resubmit the commit.\n"
for match in $matches; do
echo $match
done
echo ""
exit 1
fi
# check if trailing whitespace detected and print file name and exit with an error
echo -e "\nRunning doc8 checks\n"
source venv/bin/activate
exec doc8 source