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

Add pre-commit config to run terraform fmt #137

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

matthewhughes-uw
Copy link
Contributor

@matthewhughes-uw matthewhughes-uw commented Feb 8, 2024

Run the hook to format all the code and enforce this via CI to avoid
regressions. This is to keep formatting consistent and not a thing to
worry/think about when developing or in PRs.

This does rely on the local version of terraform people are running. I
think this can cause issues when running terraform apply across
different versions, but it should be fine for terraform fmt which I
can't imagine changes output much between versions.

@matthewhughes-uw matthewhughes-uw force-pushed the mhughes-add-terraform-fmt-pre-commit branch 5 times, most recently from 5e6ce96 to 08184cf Compare February 8, 2024 11:44
@matthewhughes-uw
Copy link
Contributor Author

@matthewhughes-uw matthewhughes-uw force-pushed the mhughes-add-terraform-fmt-pre-commit branch from be4d1bf to 08184cf Compare February 8, 2024 11:46
@matthewhughes-uw matthewhughes-uw marked this pull request as ready for review February 8, 2024 11:49
@matthewhughes-uw matthewhughes-uw requested review from a team as code owners February 8, 2024 11:49
@sbuliarca
Copy link
Contributor

Thank you!

Run the hook to format all the code and enforce this via CI to avoid
regressions. This is to keep formatting consistent and not a thing to
worry/think about when developing or in PRs.

This does rely on the local version of `terraform` people are running. I
think this can cause issues when running `terraform apply` across
different versions, but it should be fine for `terraform fmt` which I
can't imagine changes output much between versions.
@matthewhughes-uw matthewhughes-uw force-pushed the mhughes-add-terraform-fmt-pre-commit branch from 08184cf to 54ff285 Compare February 8, 2024 13:14
@matthewhughes-uw
Copy link
Contributor Author

matthewhughes-uw commented Feb 8, 2024

merging without the additional approval: the only changes to .tf files are whitespace changes and I don't want to have to rebase+run terraform fmt again each time something else is merged

@matthewhughes-uw matthewhughes-uw merged commit 2fde6b5 into main Feb 8, 2024
1 check passed
@matthewhughes-uw matthewhughes-uw deleted the mhughes-add-terraform-fmt-pre-commit branch February 8, 2024 13:17
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.

2 participants