Karan Sharma

Setting Up Your Editor for Nomad Job Specifications

1 minutes (219 words)

For formatting HCLv2 files (that Nomad job spec uses), you can use the following setup to neatly format them automatically.

🔗VSCode

    "files.associations": {
        "*.nomad": "hcl",
        "*.nomad.tpl": "hcl",
        "*.tf": "terraform",
    }

🔗Manual

go install github.com/hashicorp/hcl/v2/cmd/hclfmt@latest
#!/usr/bin/env bash
set -e
for file in *; do
  hclfmt -w $file
done

Tags: #Nomad