File tree 4 files changed +27
-4
lines changed 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -2479,6 +2479,14 @@ in
2479
2479
entry = "${ hooks . opam-lint . package } /bin/opam lint" ;
2480
2480
files = "\\ .opam$" ;
2481
2481
} ;
2482
+ opentofu-format =
2483
+ {
2484
+ name = "opentofu-format" ;
2485
+ description = "Format OpenTofu (`.tf`) files." ;
2486
+ package = tools . opentofu-fmt ;
2487
+ entry = "${ hooks . opentofu-format . package } /bin/opentofu-fmt" ;
2488
+ files = "\\ .tf$" ;
2489
+ } ;
2482
2490
ormolu =
2483
2491
{
2484
2492
name = "ormolu" ;
2848
2856
terraform-format =
2849
2857
{
2850
2858
name = "terraform-format" ;
2851
- description = "Format terraform (`.tf`) files." ;
2859
+ description = "Format Terraform (`.tf`) files." ;
2852
2860
package = tools . terraform-fmt ;
2853
2861
entry = "${ hooks . terraform-format . package } /bin/terraform-fmt" ;
2854
2862
files = "\\ .tf$" ;
Original file line number Diff line number Diff line change
1
+ { writeScriptBin , opentofu } :
2
+
3
+ writeScriptBin "opentofu-fmt" ''
4
+ #!/usr/bin/env bash
5
+ for arg in "$@"; do
6
+ dirname "$arg"
7
+ done \
8
+ | sort \
9
+ | uniq \
10
+ | while read dir; do
11
+ ${ opentofu } /bin/tofu fmt "$dir"
12
+ done
13
+ ''
Original file line number Diff line number Diff line change 1
- { writeScriptBin , opentofu } :
1
+ { writeScriptBin , terraform } :
2
2
3
- writeScriptBin "terraform-fmt" ''#!/usr/bin/env bash
3
+ writeScriptBin "terraform-fmt" ''
4
+ #!/usr/bin/env bash
4
5
for arg in "$@"; do
5
6
dirname "$arg"
6
7
done \
7
8
| sort \
8
9
| uniq \
9
10
| while read dir; do
10
- ${ opentofu } /bin/tofu fmt "$dir"
11
+ ${ terraform } /bin/terraform fmt "$dir"
11
12
done
12
13
''
Original file line number Diff line number Diff line change 176
176
hunspell = callPackage ./hunspell { } ;
177
177
purty = callPackage ./purty { purty = nodePackages . purty ; } ;
178
178
terraform-fmt = callPackage ./terraform-fmt { } ;
179
+ opentofu-fmt = callPackage ./opentofu-fmt { } ;
179
180
tflint = callPackage ./tflint { } ;
180
181
dune-build-opam-files = callPackage ./dune-build-opam-files { dune = dune_3 ; inherit ( pkgsBuildBuild ) ocaml ; } ;
181
182
dune-fmt = callPackage ./dune-fmt { dune = dune_3 ; inherit ( pkgsBuildBuild ) ocaml ; } ;
You can’t perform that action at this time.
0 commit comments