-
Notifications
You must be signed in to change notification settings - Fork 205
feat: Change terraform-format to support both Terraform and OpenTofu packages
#419
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: Change terraform-format to support both Terraform and OpenTofu packages
#419
Conversation
7b901bb to
59000fb
Compare
50e6472 to
b112f79
Compare
modules/hooks.nix
Outdated
| terraform-fmt = pkgs.writeScriptBin "terraform-fmt" '' | ||
| #!/usr/bin/env bash | ||
| opentofu_or_terraform() { |
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.
@totoroot Based on our discussion, I made a few changes to the existing terraform-format. For the time being, I feel it would be easier to alter the existing hook to work with both OpenTofu and Terraform. End users can choose whether to use OpenTofu (the default) or alter the package to Terraform, as shown in this example:
https://github.com/sestrella/test-pre-commit-hooks.nix/blob/main/devenv.nix
I'm planning to update the PR title and the issue accordingly.
terraform-format to support both Terraform and OpenTofu packages
e752c46 to
4696ed5
Compare
|
@domenkozar I just resolved the conflicts on this branch and updated the repo I was using for testing; so far, it appears to be working properly: Would you mind taking a look, please? Reference: https://github.com/sestrella/test-pre-commit-hooks.nix/actions/runs/12173105536/job/33952913600 |
35b95bc to
b1fa507
Compare
|
I refactored the |
Fixes #418