mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -05:00
fix: Actuall ignore ignored identifiers
This commit is contained in:
parent
2ee6ef4654
commit
e4d2d0e54d
3 changed files with 2 additions and 7 deletions
|
@ -249,7 +249,7 @@ impl<'i, 'w, D: typos::Dictionary> typos::Dictionary for Override<'i, 'w, D> {
|
||||||
fn correct_ident<'s, 't>(&'s self, ident: typos::tokens::Identifier<'t>) -> Option<Status<'s>> {
|
fn correct_ident<'s, 't>(&'s self, ident: typos::tokens::Identifier<'t>) -> Option<Status<'s>> {
|
||||||
for ignored in &self.ignored_identifiers {
|
for ignored in &self.ignored_identifiers {
|
||||||
if ignored.is_match(ident.token()) {
|
if ignored.is_match(ident.token()) {
|
||||||
return None;
|
return Some(Status::Valid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ impl<'s> ConfigEngine<'s> {
|
||||||
|
|
||||||
let dict = crate::dict::BuiltIn::new(dict_config.locale());
|
let dict = crate::dict::BuiltIn::new(dict_config.locale());
|
||||||
let mut dict = crate::dict::Override::new(dict);
|
let mut dict = crate::dict::Override::new(dict);
|
||||||
|
dict.ignored_identifiers(dict_config.extend_ignore_identifiers_re());
|
||||||
dict.identifiers(
|
dict.identifiers(
|
||||||
dict_config
|
dict_config
|
||||||
.extend_identifiers()
|
.extend_identifiers()
|
||||||
|
|
|
@ -8,11 +8,5 @@ error: `hello` should be `goodbye`
|
||||||
1 | hello
|
1 | hello
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
error: `hello` should be `goodbye`
|
|
||||||
--> ./file.ignore:1:1
|
|
||||||
|
|
|
||||||
1 | hello
|
|
||||||
| ^^^^^
|
|
||||||
|
|
|
||||||
"""
|
"""
|
||||||
stderr = ""
|
stderr = ""
|
||||||
|
|
Loading…
Reference in a new issue