mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-22 15:42:23 -05:00
fix(cli): Dont correct O_WRONLY
Realized we could just hard code this for now rather creating a general identifier dictionary. Fixes #744
This commit is contained in:
parent
9f1d7017e2
commit
5fd0df2881
2 changed files with 6 additions and 11 deletions
|
@ -51,8 +51,11 @@ impl BuiltIn {
|
|||
|
||||
#[cfg(feature = "dict")]
|
||||
impl BuiltIn {
|
||||
fn correct_ident_with_dict<'s>(&self, _ident: &str) -> Option<Status<'s>> {
|
||||
None
|
||||
fn correct_ident_with_dict<'s>(&self, ident: &str) -> Option<Status<'s>> {
|
||||
match ident {
|
||||
"O_WRONLY" => Some(Status::Valid),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
// Not using `Status` to avoid the allocations
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
bin.name = "typos"
|
||||
stdin = ""
|
||||
stdout = """
|
||||
error: `WRONLY` should be `WRONGLY`
|
||||
--> ./sample.py:5:12
|
||||
|
|
||||
5 | print(os.O_WRONLY) # should work
|
||||
| ^^^^^^
|
||||
|
|
||||
"""
|
||||
stdout = ""
|
||||
stderr = ""
|
||||
status.code = 2
|
||||
|
|
Loading…
Reference in a new issue