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:
Ed Page 2023-09-25 12:50:07 -05:00
parent 9f1d7017e2
commit 5fd0df2881
2 changed files with 6 additions and 11 deletions

View file

@ -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

View file

@ -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