diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..cfc98a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.100.1 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases + hooks: + - id: terraform_fmt diff --git a/Makefile b/Makefile index 8f278a5..48265c5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ -.PHONY: docs +.PHONY: docs fmt docs: $(MAKE) -C modules docs $(MAKE) -C examples docs + +fmt: + terraform fmt -recursive + +fmt-check: + terraform fmt -recursive -check