Skip to content

Commit

Permalink
Adding pre-commit-hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Nov 1, 2023
1 parent 8e7892a commit 99dcf95
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.83.4
hooks:
# - id: terraform_validate
- id: terraform_fmt
- id: terraform_docs
args: [ '--args=--config=.terraform-docs.yml', 'table' ]
exclude: common/*.tf
exclude: version.tf
exclude: examples/
- id: terraform_tflint
# args: [ "--args=--config=__GIT_WORKING_DIR__/.tflint.hcl"]
# exclude: examples/
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-symlinks
- id: detect-aws-credentials
- id: detect-private-key
# - id: end-of-file-fixer
25 changes: 25 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
formatter: markdown table

content: |-
{{ .Header }}
{{ .Requirements }}
{{ .Inputs }}
{{ .Outputs }}
{{ .Resources }}
{{ .Modules }}
{{ .Footer }}
output:
file: "README.md"
mode: replace
template: |-
{{ .Content }}
{{/** End of file fixer */}}
9 changes: 9 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugin "terraform" {
enabled = true
preset = "recommended"
}
plugin "aws" {
enabled = true
version = "0.27.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

0 comments on commit 99dcf95

Please sign in to comment.