diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8af71be74..6b3c7bccb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,22 @@ name: CI on: [push, pull_request] jobs: + spelling: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + env: + DISABLE_V8_COMPILE_CACHE: "1" + uses: actions/setup-node@v4 + with: + node-version: "20.9" + + - name: Run cspell + run: | + yarn + yarn run cspell lint_ruby: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index fcf9c2bcd..1ab5c399b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ vscode/node_modules vscode/.vscode-test/ vscode/*.vsix vscode/*.log +yarn.lock diff --git a/.vscode/settings.json b/.vscode/settings.json index 0e76c4d78..6934c1976 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,35 +14,5 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, - }, - "cSpell.languageSettings": [ - { - "languageId": "*", - "locale": "en", - "dictionaries": [ - "wordsEn" - ] - }, - { - "languageId": "*", - "locale": "en-US", - "dictionaries": [ - "wordsEn" - ] - }, - { - "languageId": "*", - "dictionaries": [ - "companies", - "softwareTerms", - "misc" - ] - }, - { - "languageId": "ruby", - "dictionaries": [ - "ruby" - ] - } ], } diff --git a/cspell.jsonc b/cspell.jsonc new file mode 100644 index 000000000..848205644 --- /dev/null +++ b/cspell.jsonc @@ -0,0 +1,37 @@ +{ + "version": "0.2", + "dictionaryDefinitions": [ + { + "name": "project-words", + "path": "./project-words", + "addWords": true + } + ], + // cspell recognizes 'addon' as valid but we want to enforce 'add-on', but not within code + "words": [ + "!addon" + ], + "ignoreRegExpList": [ + "\\.addon", + "addon\\.", + "\\(addon\\)", + "@addon", + "_addon", + "addon\\w+", + "addon_", + "addon\"", + "addon =", + "$\\s+addon^", + "\\|addon\\|", + "addon$" // could have false positives but unlikely + ], + "language": "en", + "files": ["**/*.rb", "**/*.md", "**/*.markdown"], + "ignorePaths": [ + "**/node_modules/**", + "vendor/**", + "coverage/**", + "test/fixtures/", + ], + "dictionaries": ["ruby", "en_US", "shell", "file-types", "project-words", "companies", "softwareTerms", "misc"] + } diff --git a/package.json b/package.json new file mode 100644 index 000000000..6845654bb --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "cspell": "^8.14.4" + } +}