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)
Fri, Nov 8, 8:28 PM
Unknown Object (File)
Fri, Nov 8, 8:28 PM
Unknown Object (File)
Fri, Nov 8, 8:10 AM
Unknown Object (File)
Tue, Nov 5, 2:05 AM
Unknown Object (File)
Oct 14 2024, 8:11 AM
Unknown Object (File)
Oct 14 2024, 8:09 AM
Unknown Object (File)
Oct 5 2024, 2:41 AM
Unknown Object (File)
Sep 25 2024, 2:21 AM

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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

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

Looks good!

scripts/terraform_pre_commit.sh
10

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

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