From ee32d77aba122c27b38006345490647394f2b699 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 16 Apr 2024 11:37:04 -0500 Subject: [PATCH] fix(dict): Don't correct dBA I went with the direct unit which will be considered and identifier by the casing, rather than also allowing this as a word. Fixes #997 --- crates/typos-cli/src/dict.rs | 1 + crates/typos-cli/tests/cmd/false-positives.toml | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/typos-cli/src/dict.rs b/crates/typos-cli/src/dict.rs index 25e3128..e793e0d 100644 --- a/crates/typos-cli/src/dict.rs +++ b/crates/typos-cli/src/dict.rs @@ -54,6 +54,7 @@ impl BuiltIn { fn correct_ident_with_dict<'s>(&self, ident: &str) -> Option> { match ident { "O_WRONLY" => Some(Status::Valid), + "dBA" => Some(Status::Valid), _ => None, } } diff --git a/crates/typos-cli/tests/cmd/false-positives.toml b/crates/typos-cli/tests/cmd/false-positives.toml index d966f6a..324f41d 100644 --- a/crates/typos-cli/tests/cmd/false-positives.toml +++ b/crates/typos-cli/tests/cmd/false-positives.toml @@ -1,12 +1,4 @@ bin.name = "typos" stdin = "" -stdout = """ -error: `BA` should be `BY`, `BE` - --> ./sample.txt:1:21 - | -1 | Audio volume: 23.6 dBA - | ^^ - | -""" +stdout = "" stderr = "" -status.code = 2