chore: Add deprecation notice to terraform_docs_replace (#280)

This commit is contained in:
Maksym Vlasov 2021-11-08 22:28:02 +02:00 committed by GitHub
commit af10d4f082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 17 deletions

View file

@ -20,6 +20,8 @@ If you are using `pre-commit-terraform` already or want to support its developme
## Table of content ## Table of content
* [Sponsors](#sponsors)
* [Table of content](#table-of-content)
* [How to install](#how-to-install) * [How to install](#how-to-install)
* [1. Install dependencies](#1-install-dependencies) * [1. Install dependencies](#1-install-dependencies)
* [2. Install the pre-commit hook globally](#2-install-the-pre-commit-hook-globally) * [2. Install the pre-commit hook globally](#2-install-the-pre-commit-hook-globally)
@ -30,7 +32,7 @@ If you are using `pre-commit-terraform` already or want to support its developme
* [checkov](#checkov) * [checkov](#checkov)
* [infracost_breakdown](#infracost_breakdown) * [infracost_breakdown](#infracost_breakdown)
* [terraform_docs](#terraform_docs) * [terraform_docs](#terraform_docs)
* [terraform_docs_replace](#terraform_docs_replace) * [terraform_docs_replace (deprecated)](#terraform_docs_replace-deprecated)
* [terraform_fmt](#terraform_fmt) * [terraform_fmt](#terraform_fmt)
* [terraform_providers_lock](#terraform_providers_lock) * [terraform_providers_lock](#terraform_providers_lock)
* [terraform_tflint](#terraform_tflint) * [terraform_tflint](#terraform_tflint)
@ -189,10 +191,10 @@ There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform
<!-- markdownlint-disable no-inline-html --> <!-- markdownlint-disable no-inline-html -->
| Hook name | Description | Dependencies<br><sup>[Install instructions here](#1-install-dependencies)</sup> | | Hook name | Description | Dependencies<br><sup>[Install instructions here](#1-install-dependencies)</sup> |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `checkov` | [checkov](https://github.com/bridgecrewio/checkov) static analysis of terraform templates to spot potential security issues. [Hook notes](#checkov) | `checkov`<br>Ubuntu deps: `python3`, `python3-pip` | | `checkov` | [checkov](https://github.com/bridgecrewio/checkov) static analysis of terraform templates to spot potential security issues. [Hook notes](#checkov) | `checkov`<br>Ubuntu deps: `python3`, `python3-pip` |
| `infracost_breakdown` | Check how much your infra costs with [infracost](https://github.com/infracost/infracost). [Hook notes](#infracost_breakdown) | `infracost`, `jq`, [Infracost API key](https://www.infracost.io/docs/#2-get-api-key) | `infracost_breakdown` | Check how much your infra costs with [infracost](https://github.com/infracost/infracost). [Hook notes](#infracost_breakdown) | `infracost`, `jq`, [Infracost API key](https://www.infracost.io/docs/#2-get-api-key) |
| `terraform_docs_replace` | Runs `terraform-docs` and pipes the output directly to README.md | `python3`, `terraform-docs` | | `terraform_docs_replace` | Runs `terraform-docs` and pipes the output directly to README.md. **DEPRECATED**, see [#248](https://github.com/antonbabenko/pre-commit-terraform/issues/248). [Hook notes](#terraform_docs_replace-deprecated) | `python3`, `terraform-docs` |
| `terraform_docs_without_`<br>`aggregate_type_defaults` | Inserts input and output documentation into `README.md` without aggregate type defaults. Hook notes same as for [terraform_docs](#terraform_docs) | `terraform-docs` | | `terraform_docs_without_`<br>`aggregate_type_defaults` | Inserts input and output documentation into `README.md` without aggregate type defaults. Hook notes same as for [terraform_docs](#terraform_docs) | `terraform-docs` |
| `terraform_docs` | Inserts input and output documentation into `README.md`. Recommended. [Hook notes](#terraform_docs) | `terraform-docs` | | `terraform_docs` | Inserts input and output documentation into `README.md`. Recommended. [Hook notes](#terraform_docs) | `terraform-docs` |
| `terraform_fmt` | Reformat all Terraform configuration files to a canonical format. [Hook notes](#terraform_fmt) | - | | `terraform_fmt` | Reformat all Terraform configuration files to a canonical format. [Hook notes](#terraform_fmt) | - |
@ -346,7 +348,9 @@ Unlike most other hooks, this hook triggers once if there are any changed files
- tfvars hcl --output-file terraform.tfvars.model . - tfvars hcl --output-file terraform.tfvars.model .
``` ```
### terraform_docs_replace ### terraform_docs_replace (deprecated)
**DEPRECATED**. Will be merged in [`terraform_docs`](#terraform_docs). See [#248](https://github.com/antonbabenko/pre-commit-terraform/issues/248) for details.
`terraform_docs_replace` replaces the entire README.md rather than doing string replacement between markers. Put your additional documentation at the top of your `main.tf` for it to be pulled in. The optional `--dest` argument lets you change the filename that gets created/modified. `terraform_docs_replace` replaces the entire README.md rather than doing string replacement between markers. Put your additional documentation at the top of your `main.tf` for it to be pulled in. The optional `--dest` argument lets you change the filename that gets created/modified.

View file

@ -0,0 +1,4 @@
print(
'`terraform_docs_replace` hook is DEPRECATED.'
'For details, see https://github.com/antonbabenko/pre-commit-terraform/issues/248'
)