File: detect-context.sh

package info (click to toggle)
gitlab-workhorse 7.6.0%2Bdebian-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,440 kB
  • sloc: makefile: 233; sh: 161; python: 15
file content (10 lines) | stat: -rwxr-xr-x 268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

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