summaryrefslogtreecommitdiff
path: root/workhorse/_support/detect-context.sh
blob: 60ad212decffcf21a164bc30aa74b9f5dad7878a (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

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