From da42d37d6c6feaa632e2e964c2d101aa17bd6368 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 22 Sep 2022 16:24:19 +0200 Subject: [PATCH] terraform 1.3.0 accepts a list of files Fixes #97 --- flake.lock | 6 +++--- treefmt.toml | 16 ++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index ebad395..99b4bd8 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/treefmt.toml b/treefmt.toml index 103fde8..e0ca41d 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -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"]