From 5aa093dc25a6037583cf992a771e9ad099ac678a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 25 Jul 2024 09:15:16 -0500 Subject: [PATCH] fix(dict): Don't correct countr_one Fixes #1061 --- crates/typos-cli/src/file_type_specifics.rs | 9 +++++++++ crates/typos-cli/tests/cmd/false-positives.toml | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/typos-cli/src/file_type_specifics.rs b/crates/typos-cli/src/file_type_specifics.rs index c93ab34..00fe1a9 100644 --- a/crates/typos-cli/src/file_type_specifics.rs +++ b/crates/typos-cli/src/file_type_specifics.rs @@ -7,6 +7,15 @@ pub(crate) const NO_CHECK_TYPES: &[&str] = &["cert", "lock"]; pub(crate) const TYPE_SPECIFIC_DICTS: &[(&str, StaticDictConfig)] = &[ + ( + "cpp", + StaticDictConfig { + ignore_idents: &[ + "countr_one", // `std::countr_one` + ], + ignore_words: &[], + }, + ), ( "css", StaticDictConfig { diff --git a/crates/typos-cli/tests/cmd/false-positives.toml b/crates/typos-cli/tests/cmd/false-positives.toml index 0df3d54..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: `countr` should be `counter`, `contour`, `country`, `county` - --> ./sample.cpp:3:10 - | -3 | std::countr_one(i); - | ^^^^^^ - | -""" +stdout = "" stderr = "" -status.code = 2