Skip to content

Commit cee19e8

Browse files
committed
Update README for terraform_tflint and terraform_validate
1 parent 83bbdbf commit cee19e8

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ if they are present in `README.md`.
107107
```yaml
108108
hooks:
109109
- id: terraform_tflint
110-
args: ['args=--deep']
110+
args: ['--args=--deep']
111111
```
112112

113113
In order to pass multiple args, try the following:
114114
```yaml
115115
- id: terraform_tflint
116116
args:
117-
- 'args=--deep'
118-
- 'args=--enable-rule=terraform_documented_variables'
117+
- '--args=--deep'
118+
- '--args=--enable-rule=terraform_documented_variables'
119119
```
120120

121121
## Notes about terraform_tfsec hooks
@@ -131,6 +131,41 @@ if they are present in `README.md`.
131131
}
132132
```
133133

134+
## Notes about terraform_validate hooks
135+
136+
1. `terraform_validate` supports custom arguments so you can pass supported no-color or json flags.
137+
138+
1. Example:
139+
```yaml
140+
hooks:
141+
- id: terraform_validate
142+
args: ['--args=-json']
143+
```
144+
145+
In order to pass multiple args, try the following:
146+
```yaml
147+
- id: terraform_validate
148+
args:
149+
- '--args=-json'
150+
- '--args=-no-color'
151+
```
152+
1. `terraform_validate` also supports custom environment variables passed to the pre-commit runtime
153+
154+
1. Example:
155+
```yaml
156+
hooks:
157+
- id: terraform_validate
158+
args: ['--envs=AWS_DEFAULT_REGION="us-west-2"']
159+
```
160+
161+
In order to pass multiple args, try the following:
162+
```yaml
163+
- id: terraform_validate
164+
args:
165+
- '--envs=AWS_DEFAULT_REGION="us-west-2"'
166+
- '--envs=AWS_ACCESS_KEY_ID="anaccesskey"'
167+
- '--envs=AWS_SECRET_ACCESS_KEY="asecretkey"'
168+
```
134169

135170
## Notes for developers
136171

0 commit comments

Comments
 (0)