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
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -568,9 +568,9 @@ Unlike most other hooks, this hook triggers once if there are any changed files
568
568
1. `terraform_docs` and `terraform_docs_without_aggregate_type_defaults` will insert/update documentation generated by [terraform-docs](https://github.com/terraform-docs/terraform-docs) framed by markers:
569
569
570
570
```txt
571
-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
571
+
<!-- BEGIN_TF_DOCS -->
572
572
573
-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
573
+
<!-- END_TF_DOCS -->
574
574
```
575
575
576
576
if they are present in `README.md`.
@@ -581,8 +581,8 @@ Unlike most other hooks, this hook triggers once if there are any changed files
581
581
* create a documentation file
582
582
* extend existing documentation file by appending markers to the end of the file (see item 1 above)
583
583
* use different filename for the documentation (default is `README.md`)
584
-
* use the same insertion markers as `terraform-docs` by default. It will be default in `v2.0`.
585
-
To migrate to `terraform-docs` insertion markers, run in repo root:
584
+
* use the same insertion markers as `terraform-docs`. It's default starting from `v1.93`.
585
+
To migrate everything to `terraform-docs` insertion markers, run in repo root:
586
586
587
587
```bash
588
588
grep -rl 'BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK' . | xargs sed -i 's/BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK/BEGIN_TF_DOCS/g'
@@ -595,7 +595,7 @@ Unlike most other hooks, this hook triggers once if there are any changed files
595
595
- --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
596
596
- --hook-config=--add-to-existing-file=true # Boolean. true or false
597
597
- --hook-config=--create-file-if-not-exist=true # Boolean. true or false
598
-
- --hook-config=--use-standard-markers=true # Boolean. Defaults in v1.x to false. Set to true for compatibility with terraform-docs
598
+
- --hook-config=--use-standard-markers=true # Boolean. Defaults to true (v1.93+), false (<v1.93). Set to true for compatibility with terraform-docs
599
599
```
600
600
601
601
4. You can provide [any configuration available in `terraform-docs`](https://terraform-docs.io/user-guide/configuration/) as an argument to `terraform_doc` hook, for example:
# Function which prepares hacks for old versions of `terraform` and
34
49
# `terraform-docs` that them call `terraform_docs`
@@ -124,7 +139,7 @@ function terraform_docs {
124
139
local use_path_to_file=false
125
140
local add_to_existing=false
126
141
local create_if_not_exist=false
127
-
local use_standard_markers=false
142
+
local use_standard_markers=true
128
143
129
144
read -r -a configs <<<"$hook_config"
130
145
@@ -147,14 +162,16 @@ function terraform_docs {
147
162
;;
148
163
--use-standard-markers)
149
164
use_standard_markers=$value
165
+
common::colorify "yellow""WARNING: --use-standard-markers is deprecated and will be removed in the future."
166
+
common::colorify "yellow"" All needed changes already done by the hook, feel free to remove --use-standard-markers setting from your pre-commit config"
150
167
;;
151
168
esac
152
169
done
153
170
154
-
if ["$use_standard_markers"=true];then
155
-
# update the insertion markers to those used by terraform-docs
0 commit comments