Skip to content

Commit 4437d72

Browse files
committed
GH Actions: add a basic spellcheck CI check
Follow up on PR 2472 - safeguarding that no new typos get introduced. Notes: * The "Typos" tool is known for having a low false positive ratio and being aware of code contexts. However, this also means, it may at times miss some things. When selecting it, I deemed the low false positive ratio more important. * The language has been set to `en-US` as that's the language predominantly used for the WordPress documentation. This does mean that various phrases using `en-GB` spelling will need to be fixed/updated. Ref: https://github.com/crate-ci/typos
1 parent b3713e7 commit 4437d72

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/basic-qa.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,15 @@ jobs:
254254

255255
- name: Run PHPStan
256256
run: phpstan analyse
257+
258+
typos-check:
259+
name: "Find typos"
260+
261+
runs-on: "ubuntu-latest"
262+
263+
steps:
264+
- name: "Checkout"
265+
uses: "actions/checkout@v4"
266+
267+
- name: "Search for misspellings"
268+
uses: "crate-ci/typos@v1"

_typos.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[files]
2+
extend-exclude = [
3+
"WordPress/Tests/*/*.inc",
4+
"WordPress/Tests/*/*.fixed",
5+
"WordPress/Tests/*/*.css",
6+
"WordPress/Tests/*/*.js",
7+
]
8+
ignore-hidden = true
9+
10+
[default]
11+
locale = "en-us"
12+
check-filename = true
13+
extend-ignore-identifiers-re = [
14+
# Renaming these (function/array key) names would be a BC-break.
15+
'analyse_implode',
16+
'analyse_sprintf',
17+
'cachable',
18+
'is_targetted_token',
19+
# These are search targets for sniffs, can't be helped.
20+
'avail_post_stati',
21+
'url_is_accessable_via_ssl',
22+
]
23+
24+
[default.extend-words]

0 commit comments

Comments
 (0)