summaryrefslogtreecommitdiffstats
path: root/maintainers
diff options
context:
space:
mode:
authorVictor Engmark <victor@engmark.name>2021-12-17 21:45:48 +0000
committerGitHub <noreply@github.com>2021-12-17 23:45:48 +0200
commitde125e23331d7a58e28f49df834b97e6e976298b (patch)
tree0806037fc931b9257ee0f56da43e8e655a75fef3 /maintainers
parentfacfb5b12913d99307adceb9baab16d8b545b653 (diff)
maintainers/scripts: Lint check-maintainer-github-handles.sh (#147424)
Diffstat (limited to 'maintainers')
-rwxr-xr-xmaintainers/scripts/check-maintainer-github-handles.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/maintainers/scripts/check-maintainer-github-handles.sh b/maintainers/scripts/check-maintainer-github-handles.sh
index 879a2e452cb3..a5555ca9e909 100755
--- a/maintainers/scripts/check-maintainer-github-handles.sh
+++ b/maintainers/scripts/check-maintainer-github-handles.sh
@@ -4,20 +4,19 @@
# Example how to work with the `lib.maintainers` attrset.
# Can be used to check whether all user handles are still valid.
-set -e
-
-# nixpkgs='<nixpkgs>'
-# if [ -n "$1" ]; then
+set -o errexit -o noclobber -o nounset -o pipefail
+shopt -s failglob inherit_errexit
function checkCommits {
- local user="$1"
- local tmp=$(mktemp)
+ local ret status tmp user
+ user="$1"
+ tmp=$(mktemp)
curl --silent -w "%{http_code}" \
"https://github.com/NixOS/nixpkgs/commits?author=$user" \
> "$tmp"
# the last line of tmp contains the http status
- local status=$(tail -n1 "$tmp")
- local ret=
+ status=$(tail -n1 "$tmp")
+ ret=
case $status in
200) if <"$tmp" grep -i "no commits found" > /dev/null; then
ret=1
@@ -31,7 +30,7 @@ function checkCommits {
checkCommits "$user"
ret=$?
;;
- *) printf "BAD STATUS: $(tail -n1 $tmp) for %s\n" "$user"; ret=1
+ *) printf "BAD STATUS: $(tail -n1 "$tmp") for %s\n" "$user"; ret=1
ret=1
;;
esac
@@ -63,4 +62,5 @@ nix-instantiate -A lib.maintainers --eval --strict --json \
| jq -r '.[]|.github|select(.)' \
| parallel -j5 checkUser
+# To check some arbitrary users:
# parallel -j100 checkUser ::: "eelco" "profpatsch" "Profpatsch" "a"