Skip to content

JamesWoolfenden/pre-commit

 
 

Repository files navigation

pre-commit

Build Status Latest Release pre-commit

After https://github.com/melmorabity/pre-commit-terraform-fmt

Terraform-fmt

A pre-commit hook to rewrite Terraform configuration files to a canonical format.

.pre-commit-config.yaml:

- repo: git://github.com/jameswoolfenden/pre-commit
  rev: 0.0.1
  hooks:
    - id: terraform-fmt
      # Optional argument: path to the Terraform executable
      # args: [--terraform=/usr/local/bin/terraform]

Checkov-scan

This runs the Static analysis tool https://www.checkov.io/ for Terraform, the hook automatically installs the Checkov tool.

For Checkov-scan:

- repo: git://github.com/jameswoolfenden/pre-commit
  rev: 0.0.18
  hooks:
    - id: checkov-scan
      files: \.tf$

tf2docs

Updates README.md with Terraform parameters, modules. Requires:

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

The Hook will update in-betweeen with the Terraform-Docs created content. The hook requires that terraform-docs be installed, then add a section to you pre-commit-config.yml, updating to the latest version :

- repo: git://github.com/jameswoolfenden/pre-commit
  rev: 0.0.22
  hooks:
    - id: tf2docs

Contributors

James Woolfenden
James Woolfenden
asottile
asottitle