ci: add variable naming lint to terraform validate#766
Merged
Conversation
0ef8e3a to
f8979cc
Compare
matifali
reviewed
Feb 27, 2026
Add snake_case validation for Terraform variable names into the existing terraform_validate.sh script. This runs as part of the existing "Run Terraform Validate" CI step — no new scripts or workflow changes needed. Hyphens in variable names are technically valid HCL but deprecated and non-idiomatic. The check: - Scans .tf files in changed modules for variable declarations with hyphens - Fails with actionable suggestions (shows the snake_case alternative) Fixes: - mux module: rename add-project -> add_project (bump 1.3.0 -> 1.3.1) - code-server module: rename machine-settings -> machine_settings (bump 1.4.2 -> 1.4.3)
f8979cc to
128e9aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Terraform variable names should use underscores (
snake_case), not hyphens. Hyphens are technically valid in HCL but are deprecated and non-idiomatic. This PR adds a variable name check into the existingterraform_validate.shscript so it runs as part of the existing "Run Terraform Validate" CI step — no new scripts or workflow changes needed.Changes
scripts/terraform_validate.sh— addedvalidate_variable_names().tffiles in changed modules forvariabledeclarations with hyphensterraform validatein the same CI stepFix:
code-servermodule — renamemachine-settings→machine_settings1.4.2→1.4.3Created on behalf of @matifali