|
1 | | ---- |
2 | 1 | repos: |
3 | | -- repo: git://github.com/antonbabenko/pre-commit-terraform |
4 | | - rev: v1.24.0 |
5 | | - hooks: |
6 | | - - id: terraform_fmt |
7 | | - - id: terraform_docs |
8 | | -- repo: https://github.com/pre-commit/pre-commit-hooks |
9 | | - rev: v2.4.0 |
10 | | - hooks: |
11 | | - - id: end-of-file-fixer |
12 | | - - id: trailing-whitespace |
13 | | - - id: no-commit-to-branch |
| 2 | + - repo: https://github.com/antonbabenko/pre-commit-terraform |
| 3 | + rev: v1.31.0 |
| 4 | + hooks: |
| 5 | + - id: terraform_docs |
| 6 | + always_run: true |
| 7 | + args: |
| 8 | + - --args=--sort-by-required |
| 9 | + - id: terraform_fmt |
| 10 | + - id: terraform_tflint |
| 11 | + alias: terraform_tflint_deep |
| 12 | + name: terraform_tflint_deep |
| 13 | + args: |
| 14 | + - --args=--deep |
| 15 | + - id: terraform_tflint |
| 16 | + alias: terraform_tflint_nocreds |
| 17 | + name: terraform_tflint_nocreds |
| 18 | + - id: terraform_tfsec |
| 19 | + - repo: local |
| 20 | + hooks: |
| 21 | + - id: terraform_validate |
| 22 | + name: terraform_validate |
| 23 | + entry: | |
| 24 | + bash -c ' |
| 25 | + AWS_DEFAULT_REGION=us-east-1 |
| 26 | + declare -a DIRS |
| 27 | + for FILE in "$@" |
| 28 | + do |
| 29 | + DIRS+=($(dirname "$FILE")) |
| 30 | + done |
| 31 | + for DIR in $(printf "%s\n" "${DIRS[@]}" | sort -u) |
| 32 | + do |
| 33 | + cd $(dirname "$FILE") |
| 34 | + terraform init --backend=false |
| 35 | + terraform validate . |
| 36 | + done |
| 37 | + ' |
| 38 | + language: system |
| 39 | + verbose: true |
| 40 | + files: \.tf(vars)?$ |
| 41 | + exclude: examples |
| 42 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 43 | + rev: v3.0.0 |
| 44 | + hooks: |
| 45 | + - id: check-case-conflict |
| 46 | + - id: check-json |
| 47 | + - id: check-merge-conflict |
| 48 | + - id: check-symlinks |
| 49 | + - id: check-yaml |
| 50 | + args: |
| 51 | + - --unsafe |
| 52 | + - id: end-of-file-fixer |
| 53 | + - id: trailing-whitespace |
| 54 | + - id: mixed-line-ending |
| 55 | + args: |
| 56 | + - --fix=lf |
| 57 | + - id: no-commit-to-branch |
| 58 | + - id: pretty-format-json |
| 59 | + args: |
| 60 | + - --autofix |
| 61 | + - --top-keys=name,Name |
| 62 | + - id: trailing-whitespace |
| 63 | + args: |
| 64 | + - --markdown-linebreak-ext=md |
| 65 | + exclude: README.md |
0 commit comments