elvish/tools/check-content.sh
Qi Xiao 9185e04b69 Add a tool to check "forbidden" content.
Also add a Makefile target and CI task for it.
2022-02-20 23:22:33 +00:00

18 lines
417 B
Bash
Executable File

#!/bin/sh -e
# Check Go source files for disallowed content.
echo 'Disallowed import of net/rpc:'
if find . -name '*.go' | xargs grep '"net/rpc"'; then
exit 1
else
echo ' None!'
fi
echo 'Disallowed call of unix.{Umask,Getrlimit,Setrlimit}'
if find . -name '*.go' | egrep -v '\./pkg/(mods/unix|daemon|testutil)' | xargs egrep 'unix\.(Umask|Getrlimit|Setrlimit)'; then
exit 1
else
echo ' None!'
fi