Skip to content

Commit 503d3d2

Browse files
ci(infrastructure): add TFLint configuration with azurerm plugin (#209)
## Description Added a `.tflint.hcl` configuration file at the repository root, establishing Terraform linting for `deploy/001-iac/` and its child modules. Configured TFLint v0.61.0+ with the **azurerm** plugin v0.31.1 and the **terraform recommended** preset. Disabled `terraform_comment_syntax` to preserve the repository's existing `//` and `/* */` comment conventions, and enabled documentation and naming convention enforcement rules. Closes #200 ## Type of Change - [ ] 🐛 Bug fix (non-breaking change fixing an issue) - [x] ✨ New feature (non-breaking change adding functionality) - [ ] 💥 Breaking change (fix or feature causing existing functionality to change) - [ ] 📚 Documentation update - [x] 🏗️ Infrastructure change (Terraform/IaC) - [ ] ♻️ Refactoring (no functional changes) ## Component(s) Affected - [ ] `deploy/000-prerequisites` - Azure subscription setup - [x] `deploy/001-iac` - Terraform infrastructure - [ ] `deploy/002-setup` - OSMO control plane / Helm - [ ] `deploy/004-workflow` - Training workflows - [ ] `src/training` - Python training scripts - [ ] `docs/` - Documentation ## Testing Performed - [ ] Terraform `plan` reviewed (no unexpected changes) - [ ] Terraform `apply` tested in dev environment - [ ] Training scripts tested locally with Isaac Sim - [ ] OSMO workflow submitted successfully - [ ] Smoke tests passed (`smoke_test_azure.py`) > `tflint --init` verified — azurerm plugin downloaded successfully. ## Documentation Impact - [x] No documentation changes needed - [ ] Documentation updated in this PR - [ ] Documentation issue filed ## Bug Fix Checklist *Complete this section for bug fix PRs. Skip for other contribution types.* - [ ] Linked to issue being fixed - [ ] Regression test included, OR - [ ] Justification for no regression test: ## Checklist - [x] My code follows the [project conventions](copilot-instructions.md) - [x] Commit messages follow [conventional commit format](instructions/commit-message.instructions.md) - [x] I have performed a self-review - [x] Documentation impact assessed above - [x] No new linting warnings introduced --------- Co-authored-by: Bill Berry <WilliamBerryiii@users.noreply.github.com>
1 parent 370cf44 commit 503d3d2

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ FodyWeavers.xsd
410410
# Ignore .terraform lock
411411
.terraform.lock.hcl
412412

413+
# TFLint plugin cache
414+
.tflint.d/
415+
413416
# Crash log files
414417
crash.log
415418

.tflint.hcl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/** TFLint configuration for deploy/001-iac and child modules */
2+
3+
tflint {
4+
required_version = ">= 0.61.0"
5+
}
6+
7+
config {
8+
/* call local modules so modules/ subdirectories are also linted */
9+
call_module_type = "local"
10+
format = "compact"
11+
}
12+
13+
/* bundled terraform ruleset — recommended preset excludes terraform_comment_syntax */
14+
plugin "terraform" {
15+
enabled = true
16+
preset = "recommended"
17+
}
18+
19+
/* azurerm ruleset — only available plugin for this provider stack */
20+
plugin "azurerm" {
21+
enabled = true
22+
version = "0.31.1"
23+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
24+
}
25+
26+
// terraform_comment_syntax: repo uses // and /* */ comments, not #
27+
rule "terraform_comment_syntax" {
28+
enabled = false
29+
}
30+
31+
// terraform_documented_variables: require description on all variable blocks
32+
rule "terraform_documented_variables" {
33+
enabled = true
34+
}
35+
36+
// terraform_documented_outputs: require description on all output blocks
37+
rule "terraform_documented_outputs" {
38+
enabled = true
39+
}
40+
41+
/* terraform_naming_convention: enforce snake_case across all block types */
42+
/* note: cannot scope to bool-typed variables only — snake_case is TFLint maximum */
43+
rule "terraform_naming_convention" {
44+
enabled = true
45+
}

0 commit comments

Comments
 (0)