-
-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(terraform-docs
): Add support for replace
mode for TF 0.12+; Use native saving to file for TF 0.12+. Both requires terraform-docs
v0.12.0+ which released in 2021.
#705
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6c417c1
feat(`terraform-docs`): Use native save to file for TF 0.12+ (require…
MaxymVlasov de61221
Suppress useless "README.md updated successfully" message
MaxymVlasov b5143bd
Add suport for `terraform-docs` `mode: replace`
MaxymVlasov 69a7bd3
add debug
MaxymVlasov ece0c17
Fix "no config" `value of '--output-mode' can't be empty` issue
MaxymVlasov 225d4fb
Merge branch 'master' into feat/GH-179
MaxymVlasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFYI: I'm still concerned with picking last key instead of first despite YAML requires keys to be unique — https://yaml.org/spec/1.2-old/spec.html#id2764044
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In YAML you can do next
I not sure what words in https://yaml.org/spec/1.2-old/spec.html#id2765878 exactly means, but it actually same to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have worded it a bit ambiguous. What I mean is when you do
grep -A1000 -e '^output:$' "$config_file" | grep -E '^[[:space:]]+mode:' | tail -n 1
, you actually allow the below YAML within 1001 lines starting from the first match of^output:$
:The
output
is what YAML expects to be unique node. Else YAML is incorrect.From my point of view the first occurrence of
output.mode
key with value of111
is what must be rendered as value foroutput.mode
, whilst your implementation means theoutput.mode
key with value333
is what is taken as correct value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we're trying to employ as less third-party tools as feasible and to keep solution simple, I'd suggest we take first occurrence of
output.mode
since duplicates are not allowed.