terraform 1.3.0 accepts a list of files

Fixes #97
This commit is contained in:
zimbatm 2022-09-22 16:24:19 +02:00
parent 66959743ba
commit da42d37d6c
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
2 changed files with 7 additions and 15 deletions

View File

@ -22,11 +22,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1663669617,
"narHash": "sha256-yUrzkRDc6P3hsI5TdQ5+q8gnyjadNvaM3MMEsEVS8qk=",
"lastModified": 1663819708,
"narHash": "sha256-nKyJpwzGoV+5BNLHlrEMawsDxR1i6WOXqTcHWrWE8y4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "41ac0bd371618db6dd67fd952cc5b3d6a9955a15",
"rev": "f586d35a11ec07ced41d9d62c125c6ca0006141f",
"type": "github"
},
"original": {

View File

@ -75,16 +75,8 @@ shfmt -i 2 -s -w "$@"
includes = ["*.sh"]
[formatter.terraform]
# Terraform fmt only takes one file at the time so we create a wrapper.
# See https://github.com/numtide/treefmt/issues/97
command = "/bin/sh"
options = [
"-euc",
"""
for f in "$@"; do
terraform fmt "$f"
done
""",
"--", # bash swallows the second argument when using -c
]
# Careful, only terraform 1.3.0 or later accept a list of files.
# see https://github.com/numtide/treefmt/issues/97
command = "terraform"
options = ["fmt"]
includes = ["*.tf"]