mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
docs: Add terraform_fmt usage instructions and how-to debug script with args (#242)
This commit is contained in:
parent
71f7c347c9
commit
8a6e4bf4e6
2 changed files with 55 additions and 40 deletions
8
.github/CONTRIBUTING.md
vendored
8
.github/CONTRIBUTING.md
vendored
|
|
@ -28,6 +28,14 @@ pre-commit try-repo -a ~/pre-commit-terraform # run all existing checks from rep
|
|||
|
||||
Running `pre-commit` with `try-repo` ignores all arguments specified in `.pre-commit-config.yaml`.
|
||||
|
||||
If you need to test hook with arguments, follow [pre-commit doc](https://pre-commit.com/#arguments-pattern-in-hooks) to test hooks.
|
||||
|
||||
For example, to test that the [`terraform_fmt`](../README.md#terraform_fmt) hook works fine with arguments:
|
||||
|
||||
```bash
|
||||
/tmp/pre-commit-terraform/terraform_fmt.sh --args=-diff --args=-write=false test-dir/main.tf test-dir/vars.tf
|
||||
```
|
||||
|
||||
## Run hook performance test
|
||||
|
||||
To check is your improvement not violate performance, we have dummy execution time tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue