From 3c73deefe5bbd3b4728534b4c25030d01eccaaa7 Mon Sep 17 00:00:00 2001 From: Andy Waite <13400+andyw8@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:05:06 -0400 Subject: [PATCH] Configure cspell --- .github/workflows/ci.yml | 16 +++++++ cspell.jsonc | 36 ++++++++++++++++ dev.yml | 1 + project-words | 91 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 cspell.jsonc create mode 100644 project-words diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5899ad6160..c18d460cb3 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" + cache: "yarn" + cache-dependency-path: "vscode" + + - name: Run cspell + run: yarn global add cspell && cspell lint_ruby: runs-on: ubuntu-latest steps: diff --git a/cspell.jsonc b/cspell.jsonc new file mode 100644 index 0000000000..9c48d0102d --- /dev/null +++ b/cspell.jsonc @@ -0,0 +1,36 @@ +{ + "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/**", + "test/fixtures/", + ], + "dictionaries": ["ruby", "en_US", "shell", "file-types", "project-words"] + } diff --git a/dev.yml b/dev.yml index 09543eedc7..a459bfc859 100644 --- a/dev.yml +++ b/dev.yml @@ -5,6 +5,7 @@ type: ruby up: - ruby - bundler + - cspell - node: yarn: true version: 20.9.0 diff --git a/project-words b/project-words new file mode 100644 index 0000000000..2eca47ca96 --- /dev/null +++ b/project-words @@ -0,0 +1,91 @@ +activestorage +arefs +autocorrect +autoloaded +autorun +behavior +beind +bigdecimal +bindir +binread +Bizt +Bizw +bufnr +byteslice +codepoint +codepoints +concats +copen +corge +cvar +dont +eglot +eruby +EXTGLOB +FIXEDENCODING +Floo +fnmatch +fooo +hostedtoolcache +importmap +indexables +ipairs +Itest +ivar +Jaro +Kaigi +klass +kwargs +linearization +Linearizes +linearizing +lockfiles +lspconfig +Lstart +metaprogramming +mkpath +nargs +nodoc +noreturn +nvim +oneline +overnotify +qtlzwssomeking +quickfixes +quux +quxx +rdbg +realpath +redudancy +reparsing +requireds +rhtml +rindex +rjson +rmtree +rubyfmt +rubylibdir +rubylibprefix +setqflist +shadowenv +shellwords +snode +somethi +spoom +streerc +stringio +strscan +subexpression +supertypes +suppo +unaliased +unindexed +unparser +unresolve +vcall +Vinicius +Winkler +XQRK +yarp +YARP +YJIT