From e74f428615b957c7dd359ec24bb98a5db612a966 Mon Sep 17 00:00:00 2001 From: Thomas O'Donnell Date: Mon, 4 Oct 2021 18:08:58 +0200 Subject: [PATCH] fix(terraform): Improve module triggers (#3113) Have updated which extentions trigger the terraform module, to remove the `hcl` since this gives false positives as it is used by other Hashicorp products and add the `tfstate` and `tfplan` which are more accurate indicators. --- docs/config/README.md | 6 +++--- src/configs/terraform.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index efa231fee..fbabf80dd 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -2929,7 +2929,7 @@ If you still want to enable it, [follow the example shown below](#with-terraform By default the module will be shown if any of the following conditions are met: - The current directory contains a `.terraform` folder -- Current directory contains a file with the `.tf` or `.hcl` extensions +- Current directory contains a file with the `.tf`, `.tfplan` or `.tfstate` extensions ### Options @@ -2937,8 +2937,8 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💠"` | A format string shown before the terraform workspace. | -| `detect_extensions` | `["tf", "hcl"]` | Which extensions should trigger this module. | +| `symbol` | `"💠"` | A format string shown before the terraform workspace. | +| `detect_extensions` | `["tf", "tfplan", "tfstate"]` | Which extensions should trigger this module. | | `detect_files` | `[]` | Which filenames should trigger this module. | | `detect_folders` | `[".terraform"]` | Which folders should trigger this module. | | `style` | `"bold 105"` | The style for the module. | diff --git a/src/configs/terraform.rs b/src/configs/terraform.rs index 2f68ccb32..21f6b705e 100644 --- a/src/configs/terraform.rs +++ b/src/configs/terraform.rs @@ -23,7 +23,7 @@ impl<'a> Default for TerraformConfig<'a> { symbol: "💠 ", style: "bold 105", disabled: false, - detect_extensions: vec!["tf", "hcl"], + detect_extensions: vec!["tf", "tfplan", "tfstate"], detect_files: vec![], detect_folders: vec![".terraform"], }