Skip to content

ci: add variable naming lint to terraform validate#766

Merged
DevelopmentCats merged 3 commits into
mainfrom
blink/lint-terraform-variable-names
Feb 27, 2026
Merged

ci: add variable naming lint to terraform validate#766
DevelopmentCats merged 3 commits into
mainfrom
blink/lint-terraform-variable-names

Conversation

@blinkagent
Copy link
Copy Markdown
Contributor

@blinkagent blinkagent Bot commented Feb 27, 2026

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 existing terraform_validate.sh script 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 — added validate_variable_names()

  • Scans .tf files in changed modules for variable declarations with hyphens
  • Fails with actionable fix suggestions (shows the snake_case alternative)
  • Runs after terraform validate in the same CI step

Fix: code-server module — rename machine-settingsmachine_settings

  • Renames the hyphenated variable and its reference in main.tf
  • Bumps version 1.4.21.4.3
  • Updates all README examples

Created on behalf of @matifali

@blinkagent blinkagent Bot force-pushed the blink/lint-terraform-variable-names branch from 0ef8e3a to f8979cc Compare February 27, 2026 09:10
@blinkagent blinkagent Bot changed the title ci: add lint rule to reject hyphenated Terraform variable names ci: add variable naming lint to terraform validate Feb 27, 2026
Comment thread scripts/terraform_validate.sh Outdated
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)
@blinkagent blinkagent Bot force-pushed the blink/lint-terraform-variable-names branch from f8979cc to 128e9aa Compare February 27, 2026 09:15
@matifali matifali self-assigned this Feb 27, 2026
Copy link
Copy Markdown
Collaborator

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DevelopmentCats DevelopmentCats merged commit eb38bc3 into main Feb 27, 2026
4 checks passed
@DevelopmentCats DevelopmentCats deleted the blink/lint-terraform-variable-names branch February 27, 2026 17:15
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