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.in/sample.cpp b/crates/typos-cli/tests/cmd/false-positives.in/sample.cpp new file mode 100644 index 0000000..40455b1 --- /dev/null +++ b/crates/typos-cli/tests/cmd/false-positives.in/sample.cpp @@ -0,0 +1,5 @@ +int main() { + uint8 i = 0; + std::countr_one(i); + return 0; +}