mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
feat: have option for terraform_tfsec hook to only run in relevant modified directories (#135)
This commit is contained in:
parent
266906591c
commit
108c75f979
2 changed files with 38 additions and 4 deletions
17
README.md
17
README.md
|
|
@ -121,7 +121,22 @@ if they are present in `README.md`.
|
|||
|
||||
## Notes about terraform_tfsec hooks
|
||||
|
||||
1. `terraform_tfsec` will recurse all directories/modules.
|
||||
1. `terraform_tfsec` will consume modified files that pre-commit
|
||||
passes to it, so you can perform whitelisting of directories
|
||||
or files to run against via [files](https://pre-commit.com/#config-files)
|
||||
pre-commit flag
|
||||
|
||||
1. Example:
|
||||
```yaml
|
||||
hooks:
|
||||
- id: terraform_tfsec
|
||||
files: ^prd-infra/
|
||||
```
|
||||
|
||||
The above will tell pre-commit to pass down files from the `prd-infra/` folder
|
||||
only such that the underlying `tfsec` tool can run against changed files in this
|
||||
directory, ignoring any other folders at the root level
|
||||
|
||||
1. To ignore specific warnings, follow the convention from the
|
||||
[documentation](https://github.com/liamg/tfsec#ignoring-warnings).
|
||||
1. Example:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue