File tree Expand file tree Collapse file tree 4 files changed +68
-33
lines changed Expand file tree Collapse file tree 4 files changed +68
-33
lines changed Original file line number Diff line number Diff line change 1
- # Local .terraform directories
2
- ** /.terraform /*
3
-
4
- # .tfstate files
5
- * .tfstate
6
- * .tfstate. *
7
-
8
- # Crash log files
9
- crash.log
10
-
11
- # Ignore any .tfvars files that are generated automatically for each Terraform run. Most
12
- # .tfvars files are managed as part of configuration and so should be included in
13
- # version control.
14
- #
15
- # example.tfvars
16
-
17
- # Ignore override files as they are usually used to override resources locally and so
18
- # are not checked in
19
- override.tf
20
- override.tf.json
21
- * _override.tf
22
- * _override.tf.json
23
-
24
- # Include override files you do wish to add to version control using negated pattern
25
- #
26
- # !example_override.tf
27
-
28
- # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
29
- # example: *tfplan*
30
- .terraform. *
31
- .terraform
1
+ .terraform
2
+ .terraform.lock.hcl
3
+ terraform.tfstate *
Original file line number Diff line number Diff line change 1
1
repos :
2
2
- repo : https://github.com/pre-commit/pre-commit-hooks
3
- rev : v1.2.3
3
+ rev : v5.0.0
4
4
hooks :
5
5
- id : trailing-whitespace
6
6
- repo : https://github.com/antonbabenko/pre-commit-terraform
7
- rev : v1.73.0
7
+ rev : v1.98.1
8
8
hooks :
9
9
- id : terraform_fmt
10
10
- id : terraform_validate
11
+ - id : terraform_docs
12
+ args :
13
+ - --args=--config=.terraform-docs.yml
Original file line number Diff line number Diff line change
1
+ formatter : " markdown" # this is required
2
+
3
+ version : " "
4
+
5
+ recursive :
6
+ enabled : false
7
+ path : modules
8
+
9
+ content : " "
10
+
11
+ output :
12
+ file : " README.md"
13
+ mode : inject
14
+ template : |-
15
+ <!-- BEGIN_TF_DOCS -->
16
+ {{ .Content }}
17
+ <!-- END_TF_DOCS -->
18
+
19
+ sort :
20
+ enabled : true
21
+ by : name
22
+
23
+ sections :
24
+ hide : # we remove the providers section because the actual provider used depends on the local build environment, we only document version constraints
25
+ - providers
Original file line number Diff line number Diff line change
1
+ { pkgs ? import <nixpkgs> { } , system ? builtins . currentSystem } :
2
+
3
+ let
4
+ # fake opentofu as terraform so that tools like terraform-docs pre-commit hook (which doesn't have tofu support)
5
+ # fall back to tofu
6
+ tofu_terraform =
7
+ pkgs . stdenv . mkDerivation {
8
+ name = "tofu-terraform" ;
9
+ phases = [ "installPhase" ] ;
10
+ installPhase = ''
11
+ mkdir -p $out/bin
12
+ echo '#!/usr/bin/env sh' > $out/bin/terraform
13
+ echo 'tofu $@' > $out/bin/terraform
14
+ chmod +x $out/bin/terraform
15
+ '' ;
16
+ } ;
17
+
18
+ in
19
+
20
+ pkgs . mkShell {
21
+ NIX_SHELL = "terraform-meshplatform-modules" ;
22
+ shellHook = ''
23
+ echo starting terraform-meshplatform-modules shell
24
+ '' ;
25
+
26
+ buildInputs = [
27
+ pkgs . pre-commit
28
+ pkgs . opentofu
29
+ pkgs . tflint
30
+ pkgs . terraform-docs
31
+
32
+ # fake tofu as terraform
33
+ tofu_terraform
34
+ ] ;
35
+ }
You can’t perform that action at this time.
0 commit comments