Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change terraform-format to support both Terraform and OpenTofu packages #419

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3655,9 +3655,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