bin/format and bin/check give gofumpt only the Go files that Git tracks
or would add, as they do for the other formatters. gofumpt walked into
the ignored .devenv directory, so a format in the main checkout changed
the files of a worktree there, and a check failed on its unfinished
files.
git ls-files --cached --others --exclude-standard -- "$@"
}
git ls-files --cached --others --exclude-standard -- "$@"
}
-unformatted=$(gofumpt -l .)
+unformatted=$(files '*.go' | xargs gofumpt -l)
if [ -n "$unformatted" ]; then
printf 'gofumpt: unformatted files:\n%s\n' "$unformatted" >&2
exit 1
if [ -n "$unformatted" ]; then
printf 'gofumpt: unformatted files:\n%s\n' "$unformatted" >&2
exit 1
git ls-files --cached --others --exclude-standard -- "$@"
}
git ls-files --cached --others --exclude-standard -- "$@"
}
+files '*.go' | xargs gofumpt -w
files '*.nix' | xargs nixfmt
files '*.rst' | xargs rstfmt
files '*.md' | xargs mdformat
files '*.nix' | xargs nixfmt
files '*.rst' | xargs rstfmt
files '*.md' | xargs mdformat