Skip to content

Commit

Permalink
feat(extension): add streetsidesoftware.code-spell-checker extension
Browse files Browse the repository at this point in the history
  • Loading branch information
MicLieg committed Apr 24, 2024
1 parent 5e99f6b commit b409530
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/settings.json
/node_modules
spelling_errors.json
14 changes: 14 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// https://cspell.org/configuration/
"version": "0.2",
"language": "en",
"dictionaries": [], // https://cspell.org/docs/dictionaries/
"allowCompoundWords": true,
"enableFiletypes": ["shellscript"],
"ignorePaths": ["cspell.json", "node_modules"],
"minWordLength": 4,
"maxNumberOfProblems": 100,
"flagWords": [], // List of words to be always considered incorrect
"ignoreWords": [], // Ignore allows you the specify a list of words you want to ignore
"words": [] // List of words to be ignored (even if they are in the flagWords list)
}
18 changes: 18 additions & 0 deletions spellcheck.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit b409530

Please sign in to comment.