From 53fbb820274a8c8f7b663d15cd09d739cc6ca5d4 Mon Sep 17 00:00:00 2001 From: MicLieg <38057464+MicLieg@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:35:56 +0200 Subject: [PATCH] Add streetsidesoftware.code-spell-checker extension --- .gitignore | 1 + cspell.json | 17 +++++++++++++++++ spellcheck.sh | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 cspell.json create mode 100644 spellcheck.sh diff --git a/.gitignore b/.gitignore index c6f9a44..90333c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .vscode/settings.json +spelling_errors.json diff --git a/cspell.json b/cspell.json new file mode 100644 index 0000000..18bb9c1 --- /dev/null +++ b/cspell.json @@ -0,0 +1,17 @@ +{ + "version": "0.2", + "language": "en", + "allowCompoundWords": true, + "enableFiletypes": [], + "ignorePaths": [ + "cspell.json" + ], + // FlagWords allows you to specify a list of words that will always be considered incorrect. Useful for words that are commonly misspelled. + "flagWords": [], + // Ignore allows you the specify a list of words you want to ignore. + "ignoreWords": [], + // The words list allows you to add words that will be considered correct and will be used as suggestions. + // Feel free to add newly introduced words to the list + "words": [ + ] +} diff --git a/spellcheck.sh b/spellcheck.sh new file mode 100644 index 0000000..7bbdc9c --- /dev/null +++ b/spellcheck.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# When editing this file, please check whether the changes also need to be applied to the LinuxGSM and LinuxGSM-Dev-Docs repositories. + +# Temporary file for cspell output +tempFile=$(mktemp) + +# Run cspell on all files and capture the output +cspell "**" > "$tempFile" 2>&1 + +# Process the output to extract unique words and save them to spelling_errors.json +# This assumes that the spelling errors are identifiable in a specific format from cspell output +grep "Unknown word" "$tempFile" | grep -oP "\(\K[^\)]+" | sort -u | jq -R . | jq -s . > spelling_errors.json + +# Cleanup +rm "$tempFile" + +echo "Spelling errors have been saved to spelling_errors.json"