Skip to content

Commit b409530

Browse files
committed
feat(extension): add streetsidesoftware.code-spell-checker extension
1 parent 5e99f6b commit b409530

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode/settings.json
22
/node_modules
3+
spelling_errors.json

cspell.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// https://cspell.org/configuration/
3+
"version": "0.2",
4+
"language": "en",
5+
"dictionaries": [], // https://cspell.org/docs/dictionaries/
6+
"allowCompoundWords": true,
7+
"enableFiletypes": ["shellscript"],
8+
"ignorePaths": ["cspell.json", "node_modules"],
9+
"minWordLength": 4,
10+
"maxNumberOfProblems": 100,
11+
"flagWords": [], // List of words to be always considered incorrect
12+
"ignoreWords": [], // Ignore allows you the specify a list of words you want to ignore
13+
"words": [] // List of words to be ignored (even if they are in the flagWords list)
14+
}

spellcheck.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# When editing this file, please check whether the changes also need to be applied to the LinuxGSM and LinuxGSM-Dev-Docs repositories.
4+
5+
# Temporary file for cspell output
6+
tempFile=$(mktemp)
7+
8+
# Run cspell on all files and capture the output
9+
cspell "**" > "$tempFile" 2>&1
10+
11+
# Process the output to extract unique words and save them to spelling_errors.json
12+
# This assumes that the spelling errors are identifiable in a specific format from cspell output
13+
grep "Unknown word" "$tempFile" | grep -oP "\(\K[^\)]+" | sort -u | jq -R . | jq -s . > spelling_errors.json
14+
15+
# Cleanup
16+
rm "$tempFile"
17+
18+
echo "Spelling errors have been saved to spelling_errors.json"

0 commit comments

Comments
 (0)