You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -498,18 +498,31 @@ Unlike most other hooks, this hook triggers once if there are any changed files
498
498
499
499
### terraform_docs_replace (deprecated)
500
500
501
-
**DEPRECATED**. Will be merged in [`terraform_docs`](#terraform_docs). See [#248](https://github.com/antonbabenko/pre-commit-terraform/issues/248) for details.
501
+
**DEPRECATED**. Will be merged in [`terraform_docs`](#terraform_docs).
502
502
503
-
`terraform_docs_replace`replaces the entire README.md rather than doing string replacement between markers. Put your additional documentation at the top of your `main.tf` for it to be pulled in. The optional `--dest` argument lets you change the filename that gets created/modified.
503
+
`terraform_docs_replace`replaces the entire `README.md` rather than doing string replacement between markers. Put your additional documentation at the top of your `main.tf` for it to be pulled in.
504
504
505
-
Example:
505
+
To replicate functionality in `terraform_docs` hook:
506
506
507
-
```yaml
508
-
- id: terraform_docs_replace
509
-
args:
510
-
- --sort-by-required
511
-
- --dest=TEST.md
512
-
```
507
+
1. Create `.terraform-docs.yml` in the repo root with the following content:
508
+
509
+
```yaml
510
+
formatter: "markdown"
511
+
512
+
output:
513
+
file: "README.md"
514
+
mode: replace
515
+
template: |-
516
+
{{/** End of file fixer */}}
517
+
```
518
+
519
+
2. Replace `terraform_docs_replace` hook config in `.pre-commit-config.yaml` with:
0 commit comments