|
| 1 | +--- |
| 2 | + |
| 3 | +fail_fast: true |
| 4 | +minimum_pre_commit_version: "2.6.0" |
| 5 | + |
| 6 | +repos: |
| 7 | + - # see https://github.com/pre-commit/pre-commit-hooks |
| 8 | + repo: https://github.com/pre-commit/pre-commit-hooks |
| 9 | + rev: v4.1.0 |
| 10 | + hooks: |
| 11 | + - id: check-added-large-files |
| 12 | + name: Check for accidentally added Large Files |
| 13 | + |
| 14 | + - id: check-case-conflict |
| 15 | + name: Check for cross-OS File Name Case Conflicts |
| 16 | + |
| 17 | + - id: check-merge-conflict |
| 18 | + name: Check for Git Merge Conflicts |
| 19 | + |
| 20 | + - id: check-vcs-permalinks |
| 21 | + name: Check VCS Permalinks |
| 22 | + |
| 23 | + - id: check-json |
| 24 | + name: Validate JSON files |
| 25 | + |
| 26 | + - id: check-yaml |
| 27 | + name: Validate YAML files |
| 28 | + |
| 29 | + - # see https://github.com/antonbabenko/pre-commit-terraform |
| 30 | + repo: https://github.com/antonbabenko/pre-commit-terraform |
| 31 | + rev: v1.64.0 |
| 32 | + hooks: |
| 33 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_fmt |
| 34 | + - id: terraform_fmt |
| 35 | + name: Run `terraform fmt` recursively |
| 36 | + args: |
| 37 | + - --args=-recursive |
| 38 | + |
| 39 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_validate |
| 40 | + - id: terraform_validate |
| 41 | + name: Run `terraform validate` against `examples/basic` |
| 42 | + files: examples/basic |
| 43 | + |
| 44 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_docs |
| 45 | + - id: terraform_docs |
| 46 | + name: Render documentation for Module |
| 47 | + args: |
| 48 | + - "--args=--config=.terraform-docs.yml" |
| 49 | + |
| 50 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_docs |
| 51 | + - id: terraform_docs |
| 52 | + name: Render documentation for `basic` example |
| 53 | + files: examples/basic |
| 54 | + args: |
| 55 | + - "--args=--config=.terraform-docs.yml" |
| 56 | + |
| 57 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_providers_lock |
| 58 | + - id: terraform_providers_lock |
| 59 | + name: Run `terraform init` and `terraform providers lock` |
| 60 | + |
| 61 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_tflint |
| 62 | + - id: terraform_tflint |
| 63 | + name: Run `tflint` |
| 64 | + args: |
| 65 | + - "--args=--config=__GIT_WORKING_DIR__/.tflint.hcl" |
| 66 | + |
| 67 | + # see https://github.com/antonbabenko/pre-commit-terraform#terraform_tfsec |
| 68 | + - id: terraform_tfsec |
| 69 | + name: Run `tfsec` against `examples/basic` |
| 70 | + files: "examples/basic" |
| 71 | + args: |
| 72 | + - --args= --config-file=__GIT_WORKING_DIR__/tfsec.yml |
0 commit comments