Skip to content

Commit

Permalink
build: update terraform-docs template and pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
Shr3ps committed Oct 4, 2024
1 parent 88776d1 commit 550689e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
22 changes: 13 additions & 9 deletions .config/terraform-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ sections:
content: |-
## Global versioning rule for Claranet Azure modules
| Module version | Terraform version | AzureRM version |
| -------------- | ----------------- | --------------- |
| >= 7.x.x | 1.3.x | >= 3.0 |
| >= 6.x.x | 1.x | >= 3.0 |
| >= 5.x.x | 0.15.x | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | >= 2.0 |
| >= 3.x.x | 0.12.x | >= 2.0 |
| >= 2.x.x | 0.12.x | < 2.0 |
| < 2.x.x | 0.11.x | < 2.0 |
| Module version | Terraform version | OpenTofu version | AzureRM version |
| -------------- | ----------------- | ---------------- | --------------- |
| >= 8.x.x | **Unverified** | 1.8.x | >= 4.0 |
| >= 7.x.x | 1.3.x | | >= 3.0 |
| >= 6.x.x | 1.x | | >= 3.0 |
| >= 5.x.x | 0.15.x | | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | | >= 2.0 |
| >= 3.x.x | 0.12.x | | >= 2.0 |
| >= 2.x.x | 0.12.x | | < 2.0 |
| < 2.x.x | 0.11.x | | < 2.0 |
## Contributing
Expand All @@ -38,6 +39,9 @@ content: |-
which set some terraform variables in the environment needed by this module.
More details about variables set by the `terraform-wrapper` available in the [documentation](https://github.com/claranet/terraform-wrapper#environment).
⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with
[Hashicorp Terraform](https://github.com/hashicorp/terraform/). Instead, we recommend to use [OpenTofu](https://github.com/opentofu/opentofu/).
```hcl
{{ include "examples/main/modules.tf" }}
```
Expand Down
18 changes: 10 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,33 @@ repos:
- id: detect-private-key
stages: [pre-commit]

- repo: https://github.com/antonbabenko/pre-commit-terraform.git
rev: v1.96.1
- repo: https://github.com/tofuutils/pre-commit-opentofu
rev: v2.0.0
hooks:
- id: terraform_fmt
- id: tofu_fmt
stages: [pre-commit]
- id: terraform_docs
- id: tofu_docs
stages: [pre-commit]
args:
- --args=--config=.config/terraform-docs.yml
- --hook-config=--use-standard-markers=true
exclude: "^modules|^example|^tools"
- id: terraform_validate
- id: tofu_validate
stages: [pre-commit]
exclude: ^examples
args:
- --tf-init-args=-upgrade
- --hook-config=--retry-once-with-cleanup=true
- id: terraform_tflint
- id: tofu_tflint
stages: [pre-commit]
exclude: ^examples
args:
- --args=--config=__GIT_WORKING_DIR__/.config/tflint.hcl
- --env-vars=TFLINT_LOG="info"
- id: terraform_trivy
- id: tofu_trivy
stages: [pre-commit]
args:
- --args=--severity HIGH,CRITICAL
- --args=--skip-dirs '**/.terraform'

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ This terraform module creates an [Azure WAF policy](https://learn.microsoft.com/
<!-- BEGIN_TF_DOCS -->
## Global versioning rule for Claranet Azure modules

| Module version | Terraform version | AzureRM version |
| -------------- | ----------------- | --------------- |
| >= 7.x.x | 1.3.x | >= 3.0 |
| >= 6.x.x | 1.x | >= 3.0 |
| >= 5.x.x | 0.15.x | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | >= 2.0 |
| >= 3.x.x | 0.12.x | >= 2.0 |
| >= 2.x.x | 0.12.x | < 2.0 |
| < 2.x.x | 0.11.x | < 2.0 |
| Module version | Terraform version | OpenTofu version | AzureRM version |
| -------------- | ----------------- | ---------------- | --------------- |
| >= 8.x.x | **Unverified** | 1.8.x | >= 4.0 |
| >= 7.x.x | 1.3.x | | >= 3.0 |
| >= 6.x.x | 1.x | | >= 3.0 |
| >= 5.x.x | 0.15.x | | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | | >= 2.0 |
| >= 3.x.x | 0.12.x | | >= 2.0 |
| >= 2.x.x | 0.12.x | | < 2.0 |
| < 2.x.x | 0.11.x | | < 2.0 |

## Contributing

Expand All @@ -29,6 +30,9 @@ This module is optimized to work with the [Claranet terraform-wrapper](https://g
which set some terraform variables in the environment needed by this module.
More details about variables set by the `terraform-wrapper` available in the [documentation](https://github.com/claranet/terraform-wrapper#environment).

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with
[Hashicorp Terraform](https://github.com/hashicorp/terraform/). Instead, we recommend to use [OpenTofu](https://github.com/opentofu/opentofu/).

```hcl
module "azure_region" {
source = "claranet/regions/azurerm"
Expand Down

0 comments on commit 550689e

Please sign in to comment.