mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
chore: add dockerfile (#183)
This commit is contained in:
parent
53de83359e
commit
36a269f109
3 changed files with 62 additions and 0 deletions
12
README.md
12
README.md
|
|
@ -13,6 +13,8 @@
|
|||
* [`coreutils`](https://formulae.brew.sh/formula/coreutils) required for `terraform_validate` hook on macOS (due to use of `realpath`).
|
||||
* [`checkov`](https://github.com/bridgecrewio/checkov) required for `checkov` hook.
|
||||
|
||||
or build and use the Docker image locally as mentioned below in the `Run` section.
|
||||
|
||||
##### MacOS
|
||||
|
||||
```bash
|
||||
|
|
@ -34,6 +36,7 @@ python3.7 -m pip install -U checkovpython3.7 -m pip install -U checkov
|
|||
```
|
||||
|
||||
### 2. Install the pre-commit hook globally
|
||||
Note: not needed if you use the Docker image
|
||||
|
||||
```bash
|
||||
DIR=~/.git-template
|
||||
|
|
@ -65,6 +68,15 @@ After pre-commit hook has been installed you can run it manually on all files in
|
|||
pre-commit run -a
|
||||
```
|
||||
|
||||
or you can also build and use the provided Docker container, which wraps all dependencies by
|
||||
```bash
|
||||
# first building it
|
||||
docker build -t pre-commit .
|
||||
# and then running it in the folder
|
||||
# with the terraform code you want to check by executing
|
||||
docker run -v $(pwd):/lint -w /lint pre-commit run -a
|
||||
```
|
||||
|
||||
## Available Hooks
|
||||
|
||||
There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform configurations (both `*.tf` and `*.tfvars`) and Terragrunt configurations (`*.hcl`) in a good shape:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue