From a25cc581bac8010e8677d78791712114e130cdb6 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Wed, 29 Apr 2026 23:13:11 +0530 Subject: [PATCH 1/2] add crate-ci/typos --- .gitattributes | 1 + .github/workflows/typos.yml | 17 +++++++++++++++++ .typos.toml | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/typos.yml create mode 100644 .typos.toml diff --git a/.gitattributes b/.gitattributes index e36130d7e8..39492eeac6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,6 +21,7 @@ /.husky export-ignore /.lintstagedrc.json export-ignore /.stylelintrc export-ignore +/.typos.toml export-ignore /.wp-env.json export-ignore /CHANGELOG.md export-ignore /CODE_OF_CONDUCT.md export-ignore diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 0000000000..32c7067944 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,17 @@ +name: Typos + +on: + pull_request: + branches: + - develop + +jobs: + typos: + name: Spell check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run typos + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000000..a00cb2c5f0 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,35 @@ +[files] +extend-exclude = [ + ".git/", + "node_modules/", + "vendor/", + "dist/", + "build/", + "tests/", +] +ignore-hidden = false + +[default] +extend-ignore-re = [ + "@[A-Za-z0-9_-]+", +] + +[default.extend-words] +# Casing conventions for proper nouns +"Wordpress" = "WordPress" +"wordPress" = "WordPress" +"ElasticSearch" = "Elasticsearch" +"Github" = "GitHub" + +# Typos previously found in this codebase +"utilitary" = "utility" +"heirarchal" = "hierarchical" +"mimcs" = "mimics" +"santitize" = "sanitize" +"warnngs" = "warnings" +"versino" = "version" +"degister" = "deregister" +"quries" = "queries" + +[default.extend-identifiers] +"Automattic" = "Automattic" From a08a34401f8408d90c167849b226434f9711bbad Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Thu, 30 Apr 2026 00:08:46 +0530 Subject: [PATCH 2/2] Refine to scan only standalone words --- .github/workflows/typos.yml | 3 +++ .typos.toml | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 32c7067944..391ed7d4ad 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -5,6 +5,9 @@ on: branches: - develop +permissions: + contents: read + jobs: typos: name: Spell check diff --git a/.typos.toml b/.typos.toml index a00cb2c5f0..d9425aac9d 100644 --- a/.typos.toml +++ b/.typos.toml @@ -6,21 +6,28 @@ extend-exclude = [ "dist/", "build/", "tests/", + "lang/", ] ignore-hidden = false [default] extend-ignore-re = [ "@[A-Za-z0-9_-]+", + "Fabian Marz", + "Tung Du", + "github:[^\"\\s]+", + "'[a-z][a-zA-Z0-9_]*'", + "\"[a-z][a-zA-Z0-9_]*\"", +] +# Only flag typos in standalone words. Compound identifiers (snake_case, +# kebab-case, camelCase, PascalCase mixed) often contain WordPress or +# Elasticsearch terminology baked into public APIs that can't be renamed. +extend-ignore-identifiers-re = [ + ".*[_-].*", + ".*[a-z][A-Z].*", ] [default.extend-words] -# Casing conventions for proper nouns -"Wordpress" = "WordPress" -"wordPress" = "WordPress" -"ElasticSearch" = "Elasticsearch" -"Github" = "GitHub" - # Typos previously found in this codebase "utilitary" = "utility" "heirarchal" = "hierarchical" @@ -33,3 +40,4 @@ extend-ignore-re = [ [default.extend-identifiers] "Automattic" = "Automattic" +"stati" = "stati"