diff --git a/config/config_test.go b/config/config_test.go index d967bbf5..1a149b63 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -125,13 +125,13 @@ func TestReadConfigFile(t *testing.T) { as.Equal([]string{"*.sh"}, shfmt.Includes) as.Nil(shfmt.Excludes) - // terraform - terraform, ok := cfg.Formatters["terraform"] - as.True(ok, "terraform formatter not found") - as.Equal("terraform", terraform.Command) - as.Equal([]string{"fmt"}, terraform.Options) - as.Equal([]string{"*.tf"}, terraform.Includes) - as.Nil(terraform.Excludes) + // opentofu + opentofu, ok := cfg.Formatters["opentofu"] + as.True(ok, "opentofu formatter not found") + as.Equal("tofu", opentofu.Command) + as.Equal([]string{"fmt"}, opentofu.Options) + as.Equal([]string{"*.tf"}, opentofu.Includes) + as.Nil(opentofu.Excludes) // missing foo, ok := cfg.Formatters["foo-fmt"] diff --git a/flake.nix b/flake.nix index 5653b6f6..d1fa3067 100644 --- a/flake.nix +++ b/flake.nix @@ -24,14 +24,9 @@ }; }; - outputs = inputs: let - inherit (inputs.nixpkgs) lib; - in + outputs = inputs: inputs.blueprint { inherit inputs; prefix = "nix/"; - nixpkgs.config = { - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["terraform"]; - }; }; } diff --git a/nix/packages/treefmt/formatters.nix b/nix/packages/treefmt/formatters.nix index 8f42442a..6d155a4a 100644 --- a/nix/packages/treefmt/formatters.nix +++ b/nix/packages/treefmt/formatters.nix @@ -15,7 +15,7 @@ with pkgs; [ shfmt statix deadnix - terraform + opentofu dos2unix yamlfmt # util for unit testing diff --git a/test/examples/treefmt.toml b/test/examples/treefmt.toml index 687dd6da..7c171939 100644 --- a/test/examples/treefmt.toml +++ b/test/examples/treefmt.toml @@ -80,10 +80,8 @@ options = ["-i", "2", "-s", "-w"] includes = ["*.sh"] priority = 2 -[formatter.terraform] -# Careful, only terraform 1.3.0 or later accept a list of files. -# see https://github.com/numtide/treefmt/issues/97 -command = "terraform" +[formatter.opentofu] +command = "tofu" options = ["fmt"] includes = ["*.tf"]