Skip to content

Commit b55dcfc

Browse files
authored
Drop extralinks, as #1003 discarded
1 parent dad2aa6 commit b55dcfc

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ Less verbose log levels will be implemented in [#562](https://github.com/antonba
440440

441441
> All hooks, which wrapping a tool distributed as a downloadable release binary. Not supported for `checkov`/`terraform_checkov` (pip-distributed) and for deprecated `terraform_docs_replace`.
442442

443-
1. <sup><sub><sup><a id="mhpasptv-1"></a>[🔗](#mhpasptv-1)</sup></sub></sup>
444-
You can pin a specific version of the wrapped tool per-hook, independent of whatever is on `$PATH` or baked into the Docker image. If that version isn't already cached locally, it's downloaded from the tool's GitHub releases on first use, then reused (no re-download) on every subsequent run.
443+
1. You can pin a specific version of the wrapped tool per-hook, independent of whatever is on `$PATH` or baked into the Docker image. If that version isn't already cached locally, it's downloaded from the tool's GitHub releases on first use, then reused (no re-download) on every subsequent run.
445444

446445
Config example:
447446

@@ -451,8 +450,7 @@ Less verbose log levels will be implemented in [#562](https://github.com/antonba
451450
- --hook-config=--tool-version=0.50.0
452451
```
453452

454-
2. <sup><sub><sup><a id="mhpasptv-2"></a>[🔗](#mhpasptv-2)</sup></sub></sup>
455-
The same `--tool-version` key also works on `terraform_validate`, `terraform_fmt` and `terraform_providers_lock`, which resolve their Terraform/OpenTofu binary through [`--tf-path`](#11-custom-terraform-binaries-and-opentofu-support) - by default it downloads/uses whichever of `terraform`/`opentofu` the rest of that precedence chain would otherwise have picked (`terraform`, unless it's absent from `$PATH` while `tofu` is present, in which case `opentofu`). To pick explicitly instead of relying on that auto-detection, set `--tf-path` to the literal value `terraform`, `opentofu`, or `tofu`:
453+
2. The same `--tool-version` key also works on `terraform_validate`, `terraform_fmt` and `terraform_providers_lock`, which resolve their Terraform/OpenTofu binary through [`--tf-path`](#11-custom-terraform-binaries-and-opentofu-support) - by default it downloads/uses whichever of `terraform`/`opentofu` the rest of that precedence chain would otherwise have picked (`terraform`, unless it's absent from `$PATH` while `tofu` is present, in which case `opentofu`). To pick explicitly instead of relying on that auto-detection, set `--tf-path` to the literal value `terraform`, `opentofu`, or `tofu`:
456454

457455
```yaml
458456
- id: terraform_validate
@@ -462,7 +460,7 @@ Less verbose log levels will be implemented in [#562](https://github.com/antonba
462460
```
463461

464462
> [!TIP]
465-
> 3. <sup><sub><sup><a id="mhpasptv-3"></a>[🔗](#mhpasptv-3)</sup></sub></sup> Since this resolves to a version-specific cached binary rather than mutating `$PATH`, the same hook can be listed multiple times with different pinned versions, e.g. to test compatibility across tool versions in one run:
463+
> 3. Since this resolves to a version-specific cached binary rather than mutating `$PATH`, the same hook can be listed multiple times with different pinned versions, e.g. to test compatibility across tool versions in one run:
466464
>
467465
> ```yaml
468466
> - id: terraform_tflint
@@ -473,8 +471,7 @@ Less verbose log levels will be implemented in [#562](https://github.com/antonba
473471
> - --hook-config=--tool-version=0.55.0
474472
> ```
475473

476-
4. <sup><sub><sup><a id="mhpasptv-4"></a>[🔗](#mhpasptv-4)</sup></sub></sup>
477-
By default, if a different version of the tool is already on `$PATH`, the pinned version still wins (with a warning) - this is `--hook-config=--tool-version-mode=strict`. Set it to `prefer-local` to invert that: if the tool already resolves via `$PATH`, that local binary is used as-is and no download is attempted; the pinned version is only downloaded/used as a fallback when nothing is found locally.
474+
4. By default, if a different version of the tool is already on `$PATH`, the pinned version still wins (with a warning) - this is `--hook-config=--tool-version-mode=strict`. Set it to `prefer-local` to invert that: if the tool already resolves via `$PATH`, that local binary is used as-is and no download is attempted; the pinned version is only downloaded/used as a fallback when nothing is found locally.
478475

479476
```yaml
480477
- id: terraform_tflint
@@ -483,11 +480,9 @@ Less verbose log levels will be implemented in [#562](https://github.com/antonba
483480
- --hook-config=--tool-version-mode=prefer-local
484481
```
485482

486-
5. <sup><sub><sup><a id="mhpasptv-5"></a>[🔗](#mhpasptv-5)</sup></sub></sup>
487-
By default, downloaded binaries are cached under `$XDG_CACHE_HOME/pre-commit-terraform` (or `$HOME/.cache/pre-commit-terraform` if `XDG_CACHE_HOME` is unset). Override the location with the `PCT_TOOL_CACHE_DIR` environment variable - see [Mount tools cache directory](#mount-tools-cache-directory) for the Docker case.
483+
5. By default, downloaded binaries are cached under `$XDG_CACHE_HOME/pre-commit-terraform` (or `$HOME/.cache/pre-commit-terraform` if `XDG_CACHE_HOME` is unset). Override the location with the `PCT_TOOL_CACHE_DIR` environment variable - see [Mount tools cache directory](#mount-tools-cache-directory) for the Docker case.
488484

489-
6. <sup><sub><sup><a id="mhpasptv-6"></a>[🔗](#mhpasptv-6)</sup></sub></sup>
490-
If a `GITHUB_TOKEN` environment variable is set, it's used automatically to authenticate GitHub API requests made during version resolution, the same way it already is for [building your own Docker image](#docker-usage).
485+
6. If a `GITHUB_TOKEN` environment variable is set, it's used automatically to authenticate GitHub API requests made during version resolution, the same way it already is for [building your own Docker image](#docker-usage).
491486

492487
#### Keeping pinned versions up to date with Renovate
493488

@@ -1370,7 +1365,6 @@ docker run \
13701365
ghcr.io/antonbabenko/pre-commit-terraform:$TAG run -a
13711366
```
13721367

1373-
<sup><sub><sup><a id="mtcd-1"></a>[🔗](#mtcd-1)</sup></sub></sup>
13741368
If you set `PCT_TOOL_CACHE_DIR` to a custom location, mount that path instead (and pass the same env var to the container with `-e PCT_TOOL_CACHE_DIR=...`).
13751369

13761370
## GitHub Actions

0 commit comments

Comments
 (0)