/
githubmirror
/
lazygit
Обзор
Документация
Войти
/
githubmirror
/
lazygit
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
scripts/gofumpt-check.sh
22 строки
662 B
Stefan Haller
Check gofumpt formatting with the pinned version in CI and lint
02 июл 2026, 12:16
02 июл 2026, 12:16
8af6104
Код
Авторство
О чём код?
#!/bin/sh # Checks that all Go files are gofumpt-formatted, and fails if any aren't. # Used by `just lint`, `make lint`, and CI. We run gofumpt with the version # pinned in go.mod (via `go tool`) rather than the one bundled with # golangci-lint, so that formatting is identical across all of them and the # editor. set -e script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) repo_root=$(dirname "$script_dir") cd "$repo_root" unformatted=$(go tool gofumpt -l .) if [ -n "$unformatted" ]; then echo "The following files are not formatted correctly:" echo "$unformatted" echo "Run 'just format' (or 'make format') and commit the result." exit 1 fi