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
This commit is contained in:
Ed Page 2021-10-23 08:42:30 -05:00
parent 29ebe5ab48
commit b7812e616c

View file

@ -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![