From 339c46a6edb336a42d54b0b41cbb29491a6a8573 Mon Sep 17 00:00:00 2001 From: Vincent Bockaert Date: Thu, 9 Feb 2023 18:57:01 +0100 Subject: [PATCH] ignore/types: enhance terraform default filter The default filter for terraform only checks for *.tf files, but there are quite few other terraform filetypes. The explanation for all of them can be found below (including link to documentation from Hashicorp at time of writing) - *.tf.json & *.tfvars.json is to capture the files written in JSON-based variant of the Terraform language - https://developer.hashicorp.com/terraform/language/files - *.tfvars is used to supply variables - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#6-auto-tfvars-variable-files - .terraform.lock.hcl is used as a Dependency lock file - https://developer.hashicorp.com/terraform/language/files/dependency-lock - terraform.rc & .terraformrc, *.tfrc - https://developer.hashicorp.com/terraform/cli/config/config-file PR #2412 --- crates/ignore/src/default_types.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs index e6a3a8f3..c0ca95b6 100644 --- a/crates/ignore/src/default_types.rs +++ b/crates/ignore/src/default_types.rs @@ -251,7 +251,11 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("tex", &["*.tex", "*.ltx", "*.cls", "*.sty", "*.bib", "*.dtx", "*.ins"]), ("texinfo", &["*.texi"]), ("textile", &["*.textile"]), - ("tf", &["*.tf"]), + ("tf", &[ + "*.tf", "*.auto.tfvars", "terraform.tfvars", "*.tf.json", + "*.auto.tfvars.json", "terraform.tfvars.json", "*.terraformrc", + "terraform.rc", "*.tfrc", "*.terraform.lock.hcl", + ]), ("thrift", &["*.thrift"]), ("toml", &["*.toml", "Cargo.lock"]), ("ts", &["*.ts", "*.tsx", "*.cts", "*.mts"]),