Skip to content

Commit

Permalink
feat: Change terraform-format to support both Terraform and OpenTof…
Browse files Browse the repository at this point in the history
…u packages (#419)
  • Loading branch information
sestrella authored Jan 21, 2025
1 parent 15a87ce commit 9364dc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
6 changes: 3 additions & 3 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3688,9 +3688,9 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
terraform-format =
{
name = "terraform-format";
description = "Format terraform (`.tf`) files.";
package = tools.terraform-fmt;
entry = "${hooks.terraform-format.package}/bin/terraform-fmt";
description = "Format Terraform (`.tf`) files.";
package = tools.opentofu;
entry = "${lib.getExe hooks.terraform-format.package} fmt -check -diff";
files = "\\.tf$";
};
terraform-validate =
Expand Down
12 changes: 0 additions & 12 deletions nix/terraform-fmt/default.nix

This file was deleted.

3 changes: 2 additions & 1 deletion nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
, nodePackages
, ocamlPackages
, opam
, opentofu
, ormolu
, pkgsBuildBuild
, poetry
Expand Down Expand Up @@ -137,6 +138,7 @@ in
mdsh
nil
nixpkgs-fmt
opentofu
ormolu
pre-commit-hook-ensure-sops
poetry
Expand Down Expand Up @@ -185,7 +187,6 @@ in
hpack-dir = callPackage ./hpack-dir { };
hunspell = callPackage ./hunspell { };
purty = callPackage ./purty { purty = nodePackages.purty; };
terraform-fmt = callPackage ./terraform-fmt { };
terraform-validate = callPackage ./terraform-validate { };
tflint = callPackage ./tflint { };
dune-build-opam-files = callPackage ./dune-build-opam-files { dune = dune_3; inherit (pkgsBuildBuild) ocaml; };
Expand Down

0 comments on commit 9364dc0

Please sign in to comment.