Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

sestrella
Copy link
Contributor

@sestrella sestrella commented Mar 27, 2024

Fixes #418

@sestrella sestrella changed the title Create different hooks for Terraform and OpenTofu format feat: Create different hooks for Terraform and OpenTofu format Mar 27, 2024
@sestrella sestrella force-pushed the terraform_and_opentofu_format branch from 7b901bb to 59000fb Compare March 27, 2024 16:32
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
modules/hooks.nix Outdated Show resolved Hide resolved
@sestrella sestrella force-pushed the terraform_and_opentofu_format branch from 0978932 to 50e6472 Compare April 1, 2024 19:35
@sestrella sestrella force-pushed the terraform_and_opentofu_format branch from 50e6472 to b112f79 Compare April 3, 2024 16:53
terraform-fmt = pkgs.writeScriptBin "terraform-fmt" ''
#!/usr/bin/env bash

opentofu_or_terraform() {
Copy link
Contributor Author

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.

@sestrella sestrella changed the title feat: Create different hooks for Terraform and OpenTofu format feat: Change terraform-format to support both Terraform and OpenTofu packages Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change terraform-format to support both Terraform and OpenTofu packages
2 participants