Skip to content

Commit c3fcba7

Browse files
Include tflint into the pre-commit configuration
- Ensures we do not make commits that do not follow best practices for terraform
1 parent 8872d61 commit c3fcba7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ jobs:
105105
node-version-file: .tool-versions
106106
cache: yarn
107107
- run: yarn install --immutable --immutable-cache --check-cache
108+
- uses: terraform-linters/setup-tflint@v4
109+
- name: Initialize TFLint
110+
run: tflint --chdir=terraform --init
108111
- uses: pre-commit/action@v3.0.1
109112
with:
110113
extra_args: "--all-files --hook-stage=manual"

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ repos:
44
hooks:
55
- id: terraform_fmt
66
files: \.(tf|tfvars|hcl)$
7+
- id: terraform_tflint
8+
args:
9+
- --args=--config=__GIT_WORKING_DIR__/terraform/.tflint.hcl
710
- repo: https://github.com/pre-commit/pre-commit-hooks
811
rev: v5.0.0
912
hooks:

0 commit comments

Comments
 (0)