prysm-pulse/scripts/check-todo.sh
Preston Van Loon 1f707842d2
Serve Prysm Web UI from Validator (#7470)
* Prysm web UI basic idea

* Refactor to use shared.Service interface, add sanity test

* register web server

* Determine mimetype

* Use 4242 as port for web

* Allow localhost or 127.0.0.1 for CORS. More tests, commentary

* Add flags, add site_data.go

* ignore site data

* Add sha

* gofmt

* gofmt

* fix script

* Lints

* fix vis

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2020-10-09 09:58:30 -05:00

24 lines
753 B
Bash
Executable File

#!/bin/bash
# Continuous integration script to check that TODOs are in the correct format
OUTPUT="$(grep -PrinH '(?<!context\.)todo(?!\(#{0,1}\d+\))' --include \*.go --exclude *site_data.go *)";
if [ "$OUTPUT" != "" ] ;
then
echo "Invalid TODOs found. Failing." >&2;
echo "$OUTPUT" >&2;
exit 1;
fi
while read -r line ; do
linenum=`expr $line : '^\([0-9]*:\)'`
issueNum=${line//$linenum}
issueState=$(curl https://api.github.com/repos/prysmaticlabs/prysm/issues/$issueNum | grep -o '"state":"closed"');
if [ "$issueState" != "" ];
then
echo "Issue referenced has already been closed" >&2;
echo "Issue Number: $issueNum" >&2;
exit 1;
fi
done < <(grep -PrinH -o -h '(?<!context\.)todo\(#{0,1}\K(\d+)' --include \*.go *)