root: flag British spellings in cspell (#22821)

cspell's bundled en_US dictionary accepts British spellings (colour, behaviour, organise, ...) even with language en-US. Add a flagWords list covering the common -our/-ise/-yse/-re/-ce families so they are reported as forbidden words with the American spelling offered as a fix, plus ignore entries for upstream-spelled exceptions (PatternFly pf-m-grey, lit-analyse, analyse-phase).

MERGE LAST: failFast is on, so this rule must land only after the docs/backend/frontend cleanup PRs have merged, otherwise CI fails on pre-existing British spellings.

Co-authored-by: Playpen Agent <279763771+playpen-agent@users.noreply.github.com>
This commit is contained in:
Teffen Ellis
2026-06-15 14:54:30 +02:00
committed by GitHub
parent d690ee591f
commit 3762c2764c
+81
View File
@@ -81,6 +81,82 @@
"cpp-compound-words" "cpp-compound-words"
], ],
"allowCompoundWords": true, "allowCompoundWords": true,
// British spellings to reject in favor of American variants. The `->` form
// forbids the left word and offers the right word as the suggested fix.
"flagWords": [
// -our -> -or
"colour->color",
"colours->colors",
"coloured->colored",
"colouring->coloring",
"behaviour->behavior",
"behaviours->behaviors",
"favour->favor",
"favourite->favorite",
"favourites->favorites",
"flavour->flavor",
"flavours->flavors",
"honour->honor",
"labour->labor",
"neighbour->neighbor",
"neighbours->neighbors",
// -ise/-isation -> -ize/-ization
"organise->organize",
"organised->organized",
"organising->organizing",
"organisation->organization",
"initialise->initialize",
"initialised->initialized",
"initialising->initializing",
"initialisation->initialization",
"authorise->authorize",
"authorised->authorized",
"authorisation->authorization",
"customise->customize",
"customised->customized",
"customisation->customization",
"serialise->serialize",
"serialised->serialized",
"deserialise->deserialize",
"deserialised->deserialized",
"normalise->normalize",
"normalised->normalized",
"normalisation->normalization",
"synchronise->synchronize",
"synchronised->synchronized",
"optimise->optimize",
"optimised->optimized",
"optimisation->optimization",
"recognise->recognize",
"recognised->recognized",
"specialise->specialize",
"prioritise->prioritize",
"prioritised->prioritized",
"summarise->summarize",
"summarised->summarized",
"minimise->minimize",
"maximise->maximize",
"utilise->utilize",
"finalise->finalize",
"finalised->finalized",
// -yse -> -yze
"analyse->analyze",
"analysed->analyzed",
"analysing->analyzing",
// -re -> -er
"centre->center",
"centres->centers",
"centred->centered",
// -ce -> -se and misc
"licence->license",
"defence->defense",
"catalogue->catalog",
"dialogue->dialog",
"programme->program",
"grey->gray",
"artefact->artifact",
"artefacts->artifacts"
],
"patterns": [ "patterns": [
{ {
"name": "EncodedURI", "name": "EncodedURI",
@@ -128,6 +204,11 @@
"\\w+l?ified\\b", "\\w+l?ified\\b",
// "ifying" suffix, e.g. "stringifying", "classifying". // "ifying" suffix, e.g. "stringifying", "classifying".
"\\w+l?ifying\\b", "\\w+l?ifying\\b",
// PatternFly's grey label modifier is spelled the British way upstream.
"pf-m-grey",
// External tool/path names that are spelled the British way upstream.
"lit-analyse",
"analyse-phase",
"SpellCheckerIgnoreInDocSetting", "SpellCheckerIgnoreInDocSetting",
"EncodedURI", "EncodedURI",
"Urls", "Urls",