blob: 613d716054456b1d4f6024b08407d16bc496b5c0 [file] [log] [blame]
Josh Bleecher Snyder833a0f82025-04-24 18:39:36 +00001Test autoformatting hierarchy
2
3-- bad.go --
4// This file is not properly gofmt'd.
5 package main
6-- gofmt.go --
7// This file is properly gofmt'd.
8package main
9-- goimports.go --
10// This file is properly goimport'd, but not gofumpt'd.
11package main
12
13import (
14 "fmt"
15)
16
17func main() {
18
19 fmt.Println("hi")
20}
21-- gofumpt.go --
22// This file is properly gofumpt'd.
23package main
24-- .commit --
25Initial commit
26
27-- bad.go --
28// This file is still not gofmt'd, but we won't complain, because it was already not gofmt'd.
29 package main
30
31 import "fmt"
32-- gofmt.go --
33// This file is no longer properly gofmt'd.
34 package main
35-- goimports.go --
36// If we remove the imports, it no longer is goimport'd.
37// It should thus be flagged as a formatting issue, despite being gofmt'd.
38package main
39
40func main() {
41
42 fmt.Println("hi")
43}
44-- gofumpt.go --
45// This file is properly gofmt'd, but no longer gofumpt'd.
46package main
47
48func main() {
49
50 fmt.Println("hi")
51}
52-- .commit --
53Mess with formatting
54
55-- .run_autoformat --
56/PATH/TO/REPO/gofmt.go
57/PATH/TO/REPO/gofumpt.go
58/PATH/TO/REPO/goimports.go