Files
gitlabhq/workhorse/_support/detect-context.sh
2025-07-25 09:15:16 +00:00

11 lines
338 B
Bash
Executable File

#!/bin/sh
git grep 'context.\(Background\|TODO\)' | \
grep -v -e '^[^:]*_test\.go:' -v -e "lint:allow context.Background" -v -e "lint:allow context.TODO" -e '^vendor/' -e '^_support/' -e '^cmd/[^:]*/main.go' | \
grep -e '^[^:]*\.go' | \
awk '{
print "Found disallowed use of context.Background or TODO"
print
exit 1
}'