Skip to content

Commit

Permalink
backport of commit edd2e9d
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 15, 2023
1 parent 4bdc31b commit dacccbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions command/fmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ func TestFmtCommand(t *testing.T) {
const inSuffix = ".in.hcl"
const expectedSuffix = ".out.hcl"

tmpDir := t.TempDir()

tests := []struct {
name string
testFile string
Expand Down Expand Up @@ -59,6 +57,10 @@ func TestFmtCommand(t *testing.T) {

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
tc := tc
ci.Parallel(t)

tmpDir := t.TempDir()
inFile := filepath.Join("testdata", "fmt", tc.testFile+inSuffix)
expectedFile := filepath.Join("testdata", "fmt", tc.testFile+expectedSuffix)
fmtFile := filepath.Join(tmpDir, tc.testFile+".hcl")
Expand Down
4 changes: 4 additions & 0 deletions website/content/docs/commands/fmt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ server {
client {
enabled = true
}
```

```shell-session
$ nomad fmt
agent.hcl
```

```shell-session
$ cat agent.hcl
server {
enabled = true
Expand Down

0 comments on commit dacccbe

Please sign in to comment.