X-Git-Url: https://git.giacomolli.uk/onehouse/blobdiff_plain/9ea825d64a3efaf8679990ea652ffaad0615c24c..b2dda1203fcd01639423fa01454e950c3edf39d2:/bin/check diff --git a/bin/check b/bin/check index 8449f47..98cce99 100755 --- a/bin/check +++ b/bin/check @@ -13,6 +13,15 @@ if [ -n "$unformatted" ]; then exit 1 fi +# Comment lines stay within the width of bin/reflow, with tabs as 8 columns. +long=$(files '*.go' | while read -r file; do + expand -t8 "$file" | awk -v file="$file" 'length > 80 && /^[[:space:]]*\/\//{print file ":" FNR}' +done) +if [ -n "$long" ]; then + printf 'comment lines over 80 columns, run bin/reflow:\n%s\n' "$long" >&2 + exit 1 +fi + golangci-lint run go test -race ./... files '*.nix' | xargs nixfmt --check