Skip to content

Commit

Permalink
Tag go fmt is a heavy fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Apr 11, 2024
1 parent b527747 commit 1154e09
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ func main() {
cmds := runner.Commands{
{Path: "dprint", Args: []string{"fmt"}},
{Path: "shfmt", Args: append([]string{"--language-dialect", "bash", "--write"}, bashPaths...)},
{Path: "go", Args: []string{"fmt", "./..."}},
}

// Editing them basically will be fmt in editor integrations
if *allFlag {
// nix fmt doesn't respect .gitignore, without paths, .direnv included: https://github.com/NixOS/nixfmt/issues/151
// nixfmt-rfc-style looks like using cache, if update with empty commit, it takes longtime
cmds = append(cmds, runner.Cmd{Path: "nix", Args: append([]string{"fmt"}, nixPaths...)})
cmds = append(cmds, runner.Commands{
// nix fmt doesn't respect .gitignore, without paths, .direnv included: https://github.com/NixOS/nixfmt/issues/151
// nixfmt-rfc-style looks like using cache, if update with empty commit, it takes longtime
{Path: "nix", Args: append([]string{"fmt"}, nixPaths...)},
// go fmt looks like caching, but refreshed in each commit, and it takes bit longer than others
{Path: "go", Args: []string{"fmt", "./..."}},
}...)
}

cmds.ParallelRun()
Expand Down

0 comments on commit 1154e09

Please sign in to comment.