Page MenuHomePhabricator

[services] add pre commit hook for terraform files
ClosedPublic

Authored by varun on Jul 13 2022, 1:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 5:03 PM
Unknown Object (File)
Thu, Jun 13, 6:07 PM
Unknown Object (File)
May 27 2024, 7:15 PM
Unknown Object (File)
May 27 2024, 7:15 PM
Unknown Object (File)
May 27 2024, 7:15 PM
Unknown Object (File)
May 27 2024, 7:12 PM
Unknown Object (File)
Apr 13 2024, 1:44 PM
Unknown Object (File)
Apr 13 2024, 1:44 PM

Details

Summary

Terraform has opinionated style conventions that we should follow, just so that our .tf files look consistent. This commit introduces a pre-commit hook to check the formatting and validity of our .tf files.

Test Plan

Tried to commit invalid terraform code and the hook was triggered

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Jul 13 2022, 1:27 PM

Looks good!

scripts/terraform_pre_commit.sh
10 ↗(On Diff #14446)

Just making sure there's a newline at the end of this file, correct? I think Phabricator truncates it by default (just by looking at other JS diffs that have ESLint/Flow checks that ensure a newline is at the end of the file, because Phabricator doesn't show the newline in those either).

This revision is now accepted and ready to land.Jul 13 2022, 1:54 PM
This revision now requires review to proceed.Jul 13 2022, 1:54 PM
scripts/terraform_pre_commit.sh
10 ↗(On Diff #14446)

Yeah there is, I think phabricator adds a "no new line" warning on the diff if you forget

Nice. Can you create tasks for adding these to GitHub Actions and Buildkite? Feel free to leave them as Backlog/unassigned

This revision is now accepted and ready to land.Jul 13 2022, 4:36 PM

Nice. Can you create tasks for adding these to GitHub Actions and Buildkite? Feel free to leave them as Backlog/unassigned

done