Setup Terraform pre-commit check in order to improve quality and security
Setup Terraform pre-commit check in order to improve quality and security

Setup Terraform pre-commit check in order to improve quality and security

Do not index
Do not index
Primary Keyword
Lié à Analyse sémantique (Articles liés) 1
Lié à Analyse sémantique (Articles liés)
Statut rédaction
Idée
Lié à Analyse sémantique (Articles liés) 2

Pre-commit file example

---
# yamllint disable rule:line-length
default_language_version:
  python: python3.8
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
      - id: check-json
      - id: check-merge-conflict
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
      - id: pretty-format-json
        args:
          - --autofix
      - id: detect-aws-credentials
        args:
          - --allow-missing-credentials
      - id: detect-private-key
  - repo: https://github.com/Lucas-C/pre-commit-hooks
    rev: v1.3.1
    hooks:
      - id: forbid-tabs
        exclude_types: [python, javascript, dtd, markdown, makefile, xml]
        exclude: binary|\.bin$
  - repo: https://github.com/jameswoolfenden/pre-commit-shell
    rev: 0.0.2
    hooks:
      - id: shell-lint
        exclude: template|\.template$
  - repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.32.2
    hooks:
      - id: markdownlint
  - repo: https://github.com/jameswoolfenden/pre-commit
    rev: v0.1.50
    hooks:
      - id: terraform-fmt
        language_version: python3.8
      - id: tf2docs
        language_version: python3.8
  - repo: https://github.com/bridgecrewio/checkov
    rev: 2.1.213
    hooks:
      - id: checkov
        verbose: true
        entry: checkov -d example/examplea --external-checks-dir checkov --download-external-modules true
  - repo: https://github.com/jameswoolfenden/pike
    rev: v0.1.89
    hooks:
      - id: pike-docs-go
        args: ["-d", ".", "readme"]