]> git.giacomolli.uk - onechat/blob - bin/check
Give the WhatsApp batches their own type
[onechat] / bin / check
1 #!/usr/bin/env bash
2 set -euo pipefail
3 cd "$(dirname "$0")/.."
4
5 # Lists the tracked and the new, not ignored files that match a pattern.
6 files() {
7   git ls-files --cached --others --exclude-standard -- "$@"
8 }
9
10 unformatted=$(gofumpt -l .)
11 if [ -n "$unformatted" ]; then
12   printf 'gofumpt: unformatted files:\n%s\n' "$unformatted" >&2
13   exit 1
14 fi
15
16 go vet ./...
17 golangci-lint run
18 go test -race -short ./...
19 files '*.nix' | xargs nixfmt --check
20 files '*.rst' | xargs rstfmt --check
21 files '*.md' | xargs mdformat --check
22 shellcheck bin/check bin/format bin/reflow .githooks/commit-msg