Skip to content

Commit 6b1e2f5

Browse files
authored
(IAC-407) Enable running static checks in Azure IaC repo via pre-commit tool (#223)
Why: Shift left static lint checks already in place for Azure IaC GitHub repo PR/merges
1 parent ecc6670 commit 6b1e2f5

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.pre-commit-config_template.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: meta
5+
hooks:
6+
- id: check-hooks-apply
7+
- repo: local
8+
hooks:
9+
- id: hadolint-docker-file-entrypoint
10+
name: hadolint
11+
entry: docker.io/hadolint/hadolint /bin/hadolint
12+
language: docker_image
13+
types: [dockerfile]
14+
- id: shellcheck-docker-file-entrypoint
15+
name: shellcheck
16+
entry: docker.io/koalaman/shellcheck
17+
language: docker_image
18+
types: [shell]
19+
- id: tflint-locally-installed
20+
name: tflint
21+
entry: tflint
22+
language: system
23+
types: [terraform]
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v4.1.0
26+
hooks:
27+
- id: trailing-whitespace
28+
- id: end-of-file-fixer
29+
- id: check-added-large-files
30+
- id: check-yaml

.tflint.hcl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ config {
33
}
44

55
plugin "azurerm" {
6-
enabled = true
7-
}
6+
enabled = true
7+
version = "0.14.0"
8+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
9+
}
10+
11+
rule "azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size" {
12+
enabled = false
13+
}

0 commit comments

Comments
 (0)