From b4eada2eacf6a030acd331094826e7b997b6f899 Mon Sep 17 00:00:00 2001 From: Damian Czaja Date: Thu, 6 Oct 2022 13:09:48 +0200 Subject: [PATCH] review fixes --- GNUmakefile | 1 + command/testdata/fmt/job.in.hcl | 2 +- command/testdata/fmt/job.out.hcl | 2 +- website/content/docs/commands/fmt.mdx | 22 ++++++++++++---------- website/data/docs-nav-data.json | 4 ++++ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index a5eba35487e8..0ab6bc6fb063 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -243,6 +243,7 @@ hclfmt: ## Format HCL files with hclfmt -o -name '.next' -prune \ -o -path './ui/dist' -prune \ -o -path './website/out' -prune \ + -o -path './command/testdata' -prune \ -o \( -name '*.nomad' -o -name '*.hcl' -o -name '*.tf' \) \ -print0 | xargs -0 hclfmt -w diff --git a/command/testdata/fmt/job.in.hcl b/command/testdata/fmt/job.in.hcl index b10aca23f15f..146b863b8493 100644 --- a/command/testdata/fmt/job.in.hcl +++ b/command/testdata/fmt/job.in.hcl @@ -14,4 +14,4 @@ } } } -} \ No newline at end of file +} diff --git a/command/testdata/fmt/job.out.hcl b/command/testdata/fmt/job.out.hcl index 5df05e266aba..bd3727eaa569 100644 --- a/command/testdata/fmt/job.out.hcl +++ b/command/testdata/fmt/job.out.hcl @@ -14,4 +14,4 @@ job "job1" { } } } -} \ No newline at end of file +} diff --git a/website/content/docs/commands/fmt.mdx b/website/content/docs/commands/fmt.mdx index 786488825c9c..2788805d89a9 100644 --- a/website/content/docs/commands/fmt.mdx +++ b/website/content/docs/commands/fmt.mdx @@ -17,20 +17,20 @@ consistency of style in Nomad files. nomad fmt [flags] paths ... ``` - Formats Nomad agent configuration and job file to a canonical format. - If a path is a directory, it will recursively format all files - with .nomad and .hcl extensions in the directory. - - If you provide a single dash (-) as argument, fmt will read from standard - input (STDIN) and output the processed output to standard output (STDOUT). +Formats Nomad agent configuration and job file to a canonical format. If a path +is a directory, it will recursively format all files with .nomad and .hcl +extensions in the directory. + +If you provide a single dash (-) as argument, fmt will read from standard input +(STDIN) and output the processed output to standard output (STDOUT). ## Format Options: -- `-list=false` : Don't list the files, which contain formatting inconsistencies. -- `-check` : Check if the files are valid HCL files. If not, exit status of the command - will be 1 and the incorrect files will not be formatted. +- `-list=false` : Don't list the files, which contain formatting inconsistencies. +- `-check` : Check if the files are valid HCL files. If not, exit status of the command + will be 1 and the incorrect files will not be formatted. - `-write=false` : Don't overwrite the input files. -- `-recursive` : Process also files in subdirectories. By default only the given (or current) directory is processed. +- `-recursive` : Process also files in subdirectories. By default only the given (or current) directory is processed. ## Examples @@ -44,7 +44,9 @@ server { client { enabled = true } + $ nomad fmt + agent.hcl $ cat agent.hcl server { diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index f9b3a8652751..398f1abc1856 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -429,6 +429,10 @@ } ] }, + { + "title": "fmt", + "path": "commands/fmt" + }, { "title": "job", "routes": [