From 3762c2764c4696200b63dc11b533fcd19870f69c Mon Sep 17 00:00:00 2001 From: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:54:30 +0200 Subject: [PATCH] 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> --- cspell.config.jsonc | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/cspell.config.jsonc b/cspell.config.jsonc index dfb5ded223..d7a926e556 100644 --- a/cspell.config.jsonc +++ b/cspell.config.jsonc @@ -81,6 +81,82 @@ "cpp-compound-words" ], "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": [ { "name": "EncodedURI", @@ -128,6 +204,11 @@ "\\w+l?ified\\b", // "ifying" suffix, e.g. "stringifying", "classifying". "\\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", "EncodedURI", "Urls",