From 61829081439bd9c45eeb4f8c86ef4a2d02d88252 Mon Sep 17 00:00:00 2001 From: Ethan Perruzza Date: Thu, 23 Jan 2025 14:30:59 +0100 Subject: [PATCH] ci: add cspell check Signed-off-by: Ethan Perruzza --- .github/workflows/code_quality.yml | 5 ++ cspell/cspell.json | 55 ++++++++++++++ cspell/names.txt | 14 ++++ cspell/project-words.txt | 111 +++++++++++++++++++++++++++++ cspell/unwanted-words.txt | 5 ++ package.json | 5 ++ 6 files changed, 195 insertions(+) create mode 100644 cspell/cspell.json create mode 100644 cspell/names.txt create mode 100644 cspell/project-words.txt create mode 100644 cspell/unwanted-words.txt diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index aa4993f38..f98f31b44 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -27,6 +27,11 @@ jobs: commit_titles | TERM=xterm-color .github/scripts/check-commit-titles.sh + - name: Spell check + run: | + npm install --include=dev + npm run spellcheck + check_reuse_compliance: runs-on: ubuntu-latest steps: diff --git a/cspell/cspell.json b/cspell/cspell.json new file mode 100644 index 000000000..5a3e26751 --- /dev/null +++ b/cspell/cspell.json @@ -0,0 +1,55 @@ +{ + "version": "0.2", + "language": "en", + "files": [ + "**/*.en.md", + "**/*.fr.md", + ], + "import": [ + "@cspell/dict-rust/cspell-ext.json", + "@cspell/dict-sql/cspell-ext.json", + "@cspell/dict-fr-fr/cspell-ext.json", + ], + "dictionaries": [ + "sql", + "rust", + "project-words", + "unwanted-words", + "names", + "softwareTerms", + ], + "overrides": [ + { + "filename": "**/*.en.md", + "dictionaries": [ + "en_US", + "en-gb", + ] + }, + { + "filename": "**/*.fr.md", + "dictionaries": [ + "fr-fr", + ] + }, + ], + "allowCompoundWords": false, + "caseSensitive": false, + "dictionaryDefinitions": [ + { + "name": "project-words", + "path": "./project-words.txt", + "addWords": true + }, + { + "name": "unwanted-words", + "path": "./unwanted-words.txt", + "addWords": true + }, + { + "name": "names", + "path": "./names.txt", + "addWords": true + }, + ], +} diff --git a/cspell/names.txt b/cspell/names.txt new file mode 100644 index 000000000..3383fdd1d --- /dev/null +++ b/cspell/names.txt @@ -0,0 +1,14 @@ +Klara +Breit +Senejko's +Céline +Morgane +Loïc +Dessagne +Bellebia +Djamal +Ménin +Senejko +Marchal +Durupt +Mémin diff --git a/cspell/project-words.txt b/cspell/project-words.txt new file mode 100644 index 000000000..aaa6c33c1 --- /dev/null +++ b/cspell/project-words.txt @@ -0,0 +1,111 @@ +OSRD +VecDeque +Odoo +Motis +möglich +Remarquable +opensource +TVDS +autonumber +mgsin +Isort +pytype +stringifying +mtlynch +pytest +parallelizable +macbooks +virtiofs +osxkeychain +creds +relref +balise +odometry +Tdriver +Tindication +FLOI +Twarning +maxmemory +allkeys +exploitability +EPSG +autosquash +MRSP +Dreiländer +DGEX +QGIS +Kutta's +Kutta +Runge +plpgsql +ABAC +Sémaphore +Clignotant +MARECO +STDCM +editoast +osrdyne +ERTMS +Netzgrafik +Valkey +ETCS +rabbitmq +CODEOWNERS +tchou +choo +pathfinding +topo +ralen +BAPR +xchg +networker +openrail +railjson +Cruda +typesystem +rustc +privs +modelv +privlvl +unsignaled +interprétabilité +GPRS +FRMCS +ETML +EPSF +DAAT +COVIT +VUTR +VUSS +CAPI +BMCV +IPCS +ITCS +TECS +TSCS +VUTP +IPCS +BMVU +opendata +fosdem +devroom +Österreichische +Bundesbahnen +Schweizerische +Bundesbahnen +eurobalises +eurobalise +euroloop +Euroradio +odométriques +eurocab +réplicas +scopé +scoper +hashées +linté +Transifex +refacto +fabriquants +redistribuable +tractionner diff --git a/cspell/unwanted-words.txt b/cspell/unwanted-words.txt new file mode 100644 index 000000000..20a234dad --- /dev/null +++ b/cspell/unwanted-words.txt @@ -0,0 +1,5 @@ +imagepostlinkedin +marginauto +pageinfo +dont +autoplay diff --git a/package.json b/package.json index 110830f94..cb37d580f 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,16 @@ "build": "hugo --gc --cleanDestinationDir --minify", "build:preview": "hugo --buildDrafts --buildFuture", "start": "hugo server", + "spellcheck": "cspell -c cspell/cspell.json", "test": "echo \"Error: no test specified\" && exit 1", "clean": "clean-install" }, "devDependencies": { + "@cspell/dict-fr-fr": "^2.2.5", + "@cspell/dict-rust": "^4.0.11", + "@cspell/dict-sql": "^2.2.0", "autoprefixer": "^10.4.17", + "cspell": "^8.17.2", "hugo-bin-extended": "^0.121.2", "postcss": "^8.4.33", "postcss-cli": "^11.0.0"