Skip to content

Commit

Permalink
chore: Fix terraform_validate exclude example (antonbabenko#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov authored Aug 2, 2022
1 parent be52a72 commit c767653
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ Example:
This is a [known issue](https://github.com/hashicorp/terraform/issues/28490) with Terraform and how providers are initialized in Terraform 0.15 and later. To work around this you can add an `exclude` parameter to the configuration of `terraform_validate` hook like this:
```yaml
- id: terraform_validate
exclude: '[^/]+$'
exclude: '^[^/]+$'
```
This will exclude the root directory from being processed by this hook. Then add a subdirectory like "examples" or "tests" and put an example implementation in place that defines the providers with the proper aliases, and this will give you validation of your module through the example. If instead you are using this with multiple modules in one repository you'll want to set the path prefix in the regular expression, such as `exclude: modules/offendingmodule/[^/]+$`.

Expand Down

0 comments on commit c767653

Please sign in to comment.