mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-07 21:37:04 +09:00
GO-879 Add pre-commit secrets linter
This commit is contained in:
parent
9dd968405f
commit
ffd5767b42
2 changed files with 22 additions and 4 deletions
17
.githooks/pre-push
Executable file
17
.githooks/pre-push
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
INSTALL_PYTHON=python3
|
||||
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-push)
|
||||
# end templated
|
||||
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
ARGS+=(--hook-dir "$HERE" -- "$@")
|
||||
|
||||
if [ -x "$INSTALL_PYTHON" ]; then
|
||||
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
|
||||
elif command -v pre-commit > /dev/null; then
|
||||
exec pre-commit "${ARGS[@]}"
|
||||
else
|
||||
echo '`pre-commit` not found. Please visit https://wiki.anytype.io/doc/mandatory-git-hooks-5rQt1Qyw7k ' 1>&2
|
||||
exit 1
|
||||
fi
|
|
@ -1,4 +1,5 @@
|
|||
- repo: git://github.com/dnephin/pre-commit-golang
|
||||
rev: master
|
||||
hooks:
|
||||
- id: go-fmt
|
||||
repos:
|
||||
- repo: https://github.com/zricethezav/gitleaks
|
||||
rev: v8.16.0
|
||||
hooks:
|
||||
- id: gitleaks
|
Loading…
Add table
Add a link
Reference in a new issue