docs: Fix typo in example config

Fixes #404
This commit is contained in:
Ed Page 2022-01-24 09:45:14 -06:00
parent 91281038aa
commit 900619be86
2 changed files with 23 additions and 1 deletions

View file

@ -74,7 +74,7 @@ teh = "teh"
For cases like localized content, you can disable spell checking of file contents while still checking the file name:
```toml
[type.po]
extend-globs = ["*.po"]
extend-glob = ["*.po"]
check-file = false
```
(run `typos --type-list` to see configured file types)

View file

@ -563,4 +563,26 @@ mod test {
let expected: Vec<kstring::KString> = vec!["*.foo".into(), "*.bar".into()];
assert_eq!(actual.extend_glob, expected);
}
#[test]
fn parse_extend_globs() {
let input = r#"[type.po]
extend-glob = ["*.po"]
"#;
let mut expected = Config::default();
expected.type_.patterns.insert(
"po".into(),
GlobEngineConfig {
extend_glob: vec!["*.po".into()],
engine: EngineConfig {
tokenizer: Some(TokenizerConfig::default()),
dict: Some(DictConfig::default()),
..Default::default()
},
..Default::default()
},
);
let actual = Config::from_toml(input).unwrap();
assert_eq!(actual, expected);
}
}