-
- Notifications
You must be signed in to change notification settings - Fork 576
Chore: hclfmt deprecation #900
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
Chore: hclfmt deprecation #900
Conversation
`hclfmt` is being deprecated and terragrunt produces a warning on execution, See https://github.com/gruntwork-io/terragrunt/releases/tag/v0.78.0 Fix : ``` WARN The `hclfmt` command is deprecated and will be removed in a future version of Terragrunt. Use `terragrunt hcl format` instead. ```
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe script updates the Terragrunt formatting command within a function, switching from Changes
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
hooks/terragrunt_fmt.sh (1)
65-68: 🛠️ Refactor suggestionAlign the root-hook command with the deprecation change
Therun_hook_on_whole_repoblock still uses the deprecatedterragrunt hclfmt. For consistency and to avoid future warnings, update it to the newhcl formatsubcommand.function run_hook_on_whole_repo { local -a -r args=("$@") - terragrunt hclfmt "$(pwd)" "${args[@]}" + terragrunt hcl format "$(pwd)" "${args[@]}" # return exit code to common::per_dir_hook local exit_code=$? return $exit_code }
🧹 Nitpick comments (1)
hooks/terragrunt_fmt.sh (1)
15-15: Update comment to reflect new subcommand
The inline comment still referencesterragrunt hclfmt, but the script now invokesterragrunt hcl format. Updating this will avoid confusion.- # JFYI: terragrunt hclfmt color already suppressed via PRE_COMMIT_COLOR=never + # JFYI: terragrunt hcl format color already suppressed via PRE_COMMIT_COLOR=never
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
hooks/terragrunt_fmt.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: 🧪 Tests / pytest@🐍3.9@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.13@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.13@macos-13
- GitHub Check: 🧪 Tests / pytest@🐍3.12@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.11@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.10@macos-14
- GitHub Check: 🧹 Linters / pre-commit@🐍3.13@ubuntu-latest
🔇 Additional comments (1)
hooks/terragrunt_fmt.sh (1)
49-49: Verify working-directory context or explicitly set it
You've switched toterragrunt hcl format "${args[@]}", which relies on the current directory being the target. Ifcommon::per_dir_hookcd's intodir_path, this is fine. Otherwise, you may need to pass--terragrunt-working-dir "$dir_path"to ensure the correct folder is formatted.Would you please confirm how
common::per_dir_hookmanages the working directory? If it doesn’tcd, consider:- terragrunt hcl format "${args[@]}" + terragrunt hcl format --terragrunt-working-dir "$dir_path" "${args[@]}"
| Absolutely, I should have started with an issue. Validated on 1.99.1 Thx a lot ! |
Put an
xinto the box if that apply:Description of your changes
hclfmtis being deprecated and terragrunt produces a warning on execution,See https://github.com/gruntwork-io/terragrunt/releases/tag/v0.78.0
Fix :
WARN The `hclfmt` command is deprecated and will be removed in a future version of Terragrunt. Use `terragrunt hcl format` instead.How can we test changes
With terragrunt v0.78 or above the pre-commit hook
terragrunt_fmtshould not emit any warnings.Note: for version v0.77.22 and below
hcl formatis just ignored, no error but neither format for broken files.