diff --git a/README.md b/README.md index 5f73a83..e9e819b 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/config.rs b/src/config.rs index 9ef790d..7fd85fe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -563,4 +563,26 @@ mod test { let expected: Vec = 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); + } }