mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-22 07:32:18 -05:00
parent
91281038aa
commit
900619be86
2 changed files with 23 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue