Skip to content

Commit

Permalink
Merge pull request #3 from quantum-sec/feature/XDR-1336
Browse files Browse the repository at this point in the history
XDR-1336: Add hooks for opensource repos
  • Loading branch information
arledesma authored Feb 10, 2022
2 parents 2016fbf + 7b2603a commit 340e3cc
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,35 @@

- id: terraform-validate
name: Terraform validate
description: Validates all Terraform configuration files
description: Validates all Terraform configuration files.
entry: hooks/terraform-validate.sh
language: script
files: \.tf$
exclude: \.+.terraform\/.*$
require_serial: true
args: []

- id: terraform-docs
name: terraform-docs
description: |
Generate terraform docs using the terraform-docs tool.
This hook requires expects a configuration to exist at the base of the repo.
See https://terraform-docs.io/user-guide/configuration/
example .terraform-docs.yml
formatter: "markdown table"
recursive:
enabled: true
path: modules
entry: quay.io/terraform-docs/terraform-docs:0.16.0
language: docker_image
files: (\.terraform-docs.yml|README.md|\.tf(vars)?)$
pass_filenames: false
args:
- '.'

- id: terraform-lock-fail
name: forbid .terraform.lock.hcl
description: For use with opensource terraform modules.
entry: do not commit .terraform.lock.hcl in this repository
language: fail
files: '\.terraform\.lock\.hcl$'

0 comments on commit 340e3cc

Please sign in to comment.