From: Anderson A. Giacomolli Date: Tue, 10 Nov 2026 03:24:20 +0000 (-0300) Subject: Format only the Go files of the repository X-Git-Url: http://git.giacomolli.uk/onechat/commitdiff_plain/3391e4eaab1c20e3b172c443186b1947622a679e?ds=sidebyside Format only the Go files of the repository 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. --- diff --git a/bin/check b/bin/check index 4bd9b5c..73256cb 100755 --- a/bin/check +++ b/bin/check @@ -7,7 +7,7 @@ files() { 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 diff --git a/bin/format b/bin/format index 512aca4..1638d00 100755 --- a/bin/format +++ b/bin/format @@ -7,7 +7,7 @@ files() { git ls-files --cached --others --exclude-standard -- "$@" } -gofumpt -w . +files '*.go' | xargs gofumpt -w files '*.nix' | xargs nixfmt files '*.rst' | xargs rstfmt files '*.md' | xargs mdformat