From b7812e616c101ce0f979be62c6d601dddc212b3f Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 23 Oct 2021 08:42:30 -0500 Subject: [PATCH] fix(config): Check project files with language For `rg`, keeping the file types strict makes sense, For spell checking, `Cargo.toml` is a lot more closely related in handling to `*.rs` than it is to `pyproject.toml` due to ecosystem package names. Part of #362 --- src/config.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/config.rs b/src/config.rs index f400e7c..6fcf1e7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -176,6 +176,24 @@ impl TypeEngineConfig { ..Default::default() }, }); + patterns + .entry("rust".into()) + .or_insert_with(|| GlobEngineConfig { + // From a spell-check perspective, these are more closely related to Rust than Toml + extend_glob: vec!["Cargo.toml".into()], + engine: EngineConfig { + ..Default::default() + }, + }); + patterns + .entry("python".into()) + .or_insert_with(|| GlobEngineConfig { + // From a spell-check perspective, these are more closely related to Python than Toml + extend_glob: vec!["pyproject.toml".into()], + engine: EngineConfig { + ..Default::default() + }, + }); patterns.entry("cert".into()).or_insert_with(|| { GlobEngineConfig { extend_glob: vec![