From 65723eacdeb5d287fa17297f8e5d1fd11263f693 Mon Sep 17 00:00:00 2001 From: "street-side-software-automation[bot]" <74785433+street-side-software-automation[bot]@users.noreply.github.com> Date: Sun, 21 Aug 2022 17:59:34 +0200 Subject: [PATCH] feat: Update CSpell to (6.8.0) (main) (#908) fix: Update CSpell to (6.8.0) Co-authored-by: Jason3S --- action-src/package.json | 4 +- .../@cspell/cspell-bundled-dicts/package.json | 12 +- .../@cspell/cspell-pipe/package.json | 6 +- .../@cspell/cspell-service-bus/package.json | 6 +- .../@cspell/cspell-types/cspell.schema.json | 16 ++ .../cspell-types/dist/CSpellReporter.js | 7 +- .../@cspell/cspell-types/dist/configFields.js | 1 + .../@cspell/cspell-types/package.json | 4 +- .../cspell-gitignore/package.json | 8 +- action/node_modules/cspell-glob/package.json | 6 +- .../node_modules/cspell-grammar/package.json | 10 +- action/node_modules/cspell-io/package.json | 8 +- .../cspell-lib/dist/Settings/InDocSettings.js | 120 ++++++++++++-- .../dist/Settings/RegExpPatterns.js | 2 +- .../createSpellingDictionary.js | 3 +- action/node_modules/cspell-lib/dist/index.js | 4 +- .../cspell-lib/dist/spellCheckFile.js | 17 +- .../dist/textValidation/checkText.js | 152 ++++++++++++++++++ .../dist/textValidation/docValidator.js | 44 ++++- .../cspell-lib/dist/textValidation/index.js | 12 +- .../dist/textValidation/validator.js | 94 +++-------- .../node_modules/cspell-lib/dist/validator.js | 3 +- action/node_modules/cspell-lib/package.json | 26 +-- .../node_modules/cspell-trie-lib/package.json | 14 +- .../node_modules/cspell/dist/application.js | 17 +- .../node_modules/cspell/dist/cli-reporter.js | 3 +- .../node_modules/cspell/dist/commandCheck.js | 2 + .../node_modules/cspell/dist/commandLint.js | 2 + action/node_modules/cspell/dist/lint/lint.js | 6 +- .../cspell/dist/util/cache/DiskCache.js | 35 ++-- .../cspell/dist/util/cache/createCache.js | 18 ++- .../cspell/dist/util/cache/fileEntryCache.js | 106 ++++++++++++ .../cspell/dist/util/fileHelper.js | 1 + action/node_modules/cspell/package.json | 18 +-- action/package.json | 4 +- yarn.lock | 130 +++++++-------- 36 files changed, 671 insertions(+), 250 deletions(-) create mode 100644 action/node_modules/cspell-lib/dist/textValidation/checkText.js create mode 100644 action/node_modules/cspell/dist/util/cache/fileEntryCache.js diff --git a/action-src/package.json b/action-src/package.json index 653dcbfae..0debaefca 100644 --- a/action-src/package.json +++ b/action-src/package.json @@ -38,8 +38,8 @@ "@octokit/core": "^4.0.5", "@octokit/plugin-rest-endpoint-methods": "^6.3.0", "@octokit/rest": "^19.0.4", - "cspell": "^6.7.0", - "cspell-glob": "^6.7.0", + "cspell": "^6.8.0", + "cspell-glob": "^6.8.0", "vscode-uri": "^3.0.3" } } diff --git a/action/node_modules/@cspell/cspell-bundled-dicts/package.json b/action/node_modules/@cspell/cspell-bundled-dicts/package.json index 665850e52..5f877938e 100644 --- a/action/node_modules/@cspell/cspell-bundled-dicts/package.json +++ b/action/node_modules/@cspell/cspell-bundled-dicts/package.json @@ -1,6 +1,6 @@ { "name": "@cspell/cspell-bundled-dicts", - "version": "6.7.0", + "version": "6.8.0", "description": "Dictionaries bundled with cspell", "publishConfig": { "access": "public" @@ -57,14 +57,14 @@ "@cspell/dict-dotnet": "^2.0.1", "@cspell/dict-elixir": "^2.0.1", "@cspell/dict-en-gb": "^1.1.33", - "@cspell/dict-en_us": "^2.3.1", + "@cspell/dict-en_us": "^2.3.2", "@cspell/dict-filetypes": "^2.1.1", "@cspell/dict-fonts": "^2.0.1", "@cspell/dict-fullstack": "^2.0.6", "@cspell/dict-git": "^1.0.1", "@cspell/dict-golang": "^3.0.1", "@cspell/dict-haskell": "^2.0.1", - "@cspell/dict-html": "^3.0.4", + "@cspell/dict-html": "^3.0.5", "@cspell/dict-html-symbol-entities": "^3.0.0", "@cspell/dict-java": "^3.0.7", "@cspell/dict-latex": "^2.0.9", @@ -90,8 +90,8 @@ "node": ">=14" }, "devDependencies": { - "@cspell/cspell-tools": "^6.7.0", - "@cspell/cspell-types": "^6.7.0" + "@cspell/cspell-tools": "^6.8.0", + "@cspell/cspell-types": "^6.8.0" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/@cspell/cspell-pipe/package.json b/action/node_modules/@cspell/cspell-pipe/package.json index 712595588..f49750f51 100644 --- a/action/node_modules/@cspell/cspell-pipe/package.json +++ b/action/node_modules/@cspell/cspell-pipe/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "6.7.0", + "version": "6.8.0", "description": "Library to make working with Iterators/AsyncIterators easier.", "keywords": [ "cspell", @@ -93,9 +93,9 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/@cspell/cspell-service-bus/package.json b/action/node_modules/@cspell/cspell-service-bus/package.json index 47a2a7ff5..62132c606 100644 --- a/action/node_modules/@cspell/cspell-service-bus/package.json +++ b/action/node_modules/@cspell/cspell-service-bus/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "6.7.0", + "version": "6.8.0", "description": "A Library for connecting requests to services that can fulfill them.", "keywords": [ "cspell" @@ -70,9 +70,9 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/@cspell/cspell-types/cspell.schema.json b/action/node_modules/@cspell/cspell-types/cspell.schema.json index dd179fa5c..f330fa7e8 100644 --- a/action/node_modules/@cspell/cspell-types/cspell.schema.json +++ b/action/node_modules/@cspell/cspell-types/cspell.schema.json @@ -2,9 +2,21 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { + "CacheFormat": { + "enum": [ + "legacy", + "universal" + ], + "type": "string" + }, "CacheSettings": { "additionalProperties": false, "properties": { + "cacheFormat": { + "$ref": "#/definitions/CacheFormat", + "default": "legacy", + "description": "Format of the cache file.\n- `legacy` - use absolute paths in the cache file\n- `universal` - use a sharable format." + }, "cacheLocation": { "$ref": "#/definitions/FSPathResolvable", "description": "Path to the cache location. Can be a file or a directory. If none specified `.cspellcache` will be used. Relative paths are relative to the config file in which it is defined.\n\nA prefix of `${cwd}` is replaced with the current working directory." @@ -1461,6 +1473,10 @@ }, "type": "array" }, + "validateDirectives": { + "description": "Verify that the in-document directives are correct.", + "type": "boolean" + }, "version": { "$ref": "#/definitions/Version", "default": "0.2", diff --git a/action/node_modules/@cspell/cspell-types/dist/CSpellReporter.js b/action/node_modules/@cspell/cspell-types/dist/CSpellReporter.js index 284090fab..e56f57213 100644 --- a/action/node_modules/@cspell/cspell-types/dist/CSpellReporter.js +++ b/action/node_modules/@cspell/cspell-types/dist/CSpellReporter.js @@ -1,6 +1,11 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessageTypes = void 0; +exports.MessageTypes = exports.IssueType = void 0; +var IssueType; +(function (IssueType) { + IssueType[IssueType["spelling"] = 0] = "spelling"; + IssueType[IssueType["directive"] = 1] = "directive"; +})(IssueType = exports.IssueType || (exports.IssueType = {})); exports.MessageTypes = { Debug: 'Debug', Info: 'Info', diff --git a/action/node_modules/@cspell/cspell-types/dist/configFields.js b/action/node_modules/@cspell/cspell-types/dist/configFields.js index 3608a2057..ed4ef7f12 100644 --- a/action/node_modules/@cspell/cspell-types/dist/configFields.js +++ b/action/node_modules/@cspell/cspell-types/dist/configFields.js @@ -46,6 +46,7 @@ exports.ConfigFields = { useGitignore: 'useGitignore', usePnP: 'usePnP', userWords: 'userWords', + validateDirectives: 'validateDirectives', words: 'words', // Experimental parser: 'parser', diff --git a/action/node_modules/@cspell/cspell-types/package.json b/action/node_modules/@cspell/cspell-types/package.json index 1b67e3a66..81787003b 100644 --- a/action/node_modules/@cspell/cspell-types/package.json +++ b/action/node_modules/@cspell/cspell-types/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "6.7.0", + "version": "6.8.0", "description": "Types for cspell and cspell-lib", "type": "commonjs", "main": "dist/index.js", @@ -69,5 +69,5 @@ "ts-json-schema-generator": "^1.0.0", "typescript": "^4.7.4" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-gitignore/package.json b/action/node_modules/cspell-gitignore/package.json index 87e63968f..ca7c11dfe 100644 --- a/action/node_modules/cspell-gitignore/package.json +++ b/action/node_modules/cspell-gitignore/package.json @@ -1,6 +1,6 @@ { "name": "cspell-gitignore", - "version": "6.7.0", + "version": "6.8.0", "description": "Gitignore Glob matcher for cspell", "keywords": [ "cspell", @@ -47,13 +47,13 @@ "node": ">=14" }, "dependencies": { - "cspell-glob": "^6.7.0", + "cspell-glob": "^6.8.0", "find-up": "^5.0.0" }, "devDependencies": { - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-glob/package.json b/action/node_modules/cspell-glob/package.json index 67ddf8178..58067e634 100644 --- a/action/node_modules/cspell-glob/package.json +++ b/action/node_modules/cspell-glob/package.json @@ -1,6 +1,6 @@ { "name": "cspell-glob", - "version": "6.7.0", + "version": "6.8.0", "description": "Glob matcher for cspell", "keywords": [ "cspell", @@ -46,9 +46,9 @@ }, "devDependencies": { "@types/micromatch": "^4.0.2", - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-grammar/package.json b/action/node_modules/cspell-grammar/package.json index eb2f6b230..99148f173 100644 --- a/action/node_modules/cspell-grammar/package.json +++ b/action/node_modules/cspell-grammar/package.json @@ -1,6 +1,6 @@ { "name": "cspell-grammar", - "version": "6.7.0", + "version": "6.8.0", "description": "Grammar parsing support for cspell", "keywords": [ "cspell", @@ -64,13 +64,13 @@ "node": ">=14" }, "devDependencies": { - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, "dependencies": { - "@cspell/cspell-pipe": "^6.7.0", - "@cspell/cspell-types": "^6.7.0" + "@cspell/cspell-pipe": "^6.8.0", + "@cspell/cspell-types": "^6.8.0" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-io/package.json b/action/node_modules/cspell-io/package.json index 47213078c..660ea0ccd 100644 --- a/action/node_modules/cspell-io/package.json +++ b/action/node_modules/cspell-io/package.json @@ -1,6 +1,6 @@ { "name": "cspell-io", - "version": "6.7.0", + "version": "6.8.0", "description": "A library of useful I/O functions used across various cspell tools.", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -39,16 +39,16 @@ }, "devDependencies": { "@types/fs-extra": "^9.0.13", - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "fs-extra": "^10.1.0", "jest": "^28.1.3", "lorem-ipsum": "^2.0.8", "rimraf": "^3.0.2" }, "dependencies": { - "@cspell/cspell-service-bus": "^6.7.0", + "@cspell/cspell-service-bus": "^6.8.0", "@types/node-fetch": "^2.6.2", "node-fetch": "^2.6.7" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-lib/dist/Settings/InDocSettings.js b/action/node_modules/cspell-lib/dist/Settings/InDocSettings.js index cfcaa12d5..1fd550d50 100644 --- a/action/node_modules/cspell-lib/dist/Settings/InDocSettings.js +++ b/action/node_modules/cspell-lib/dist/Settings/InDocSettings.js @@ -23,14 +23,57 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.internal = exports.getIgnoreRegExpFromDocument = exports.getIgnoreWordsFromDocument = exports.getInDocumentSettings = void 0; +exports.internal = exports.getIgnoreRegExpFromDocument = exports.getIgnoreWordsFromDocument = exports.regExSpellingGuardLine = exports.regExSpellingGuardNext = exports.regExSpellingGuardBlock = exports.validateInDocumentSettings = exports.getInDocumentSettings = void 0; +const cspell_pipe_1 = require("@cspell/cspell-pipe"); const gensequence_1 = require("gensequence"); +const SpellingDictionary_1 = require("../SpellingDictionary"); const Text = __importStar(require("../util/text")); const util_1 = require("../util/util"); const CSpellSettingsServer_1 = require("./CSpellSettingsServer"); // cspell:ignore gimuy const regExMatchRegEx = /\/.*\/[gimuy]*/; -const regExInFileSettings = [/(?:spell-?checker|c?spell)::?(.*)/gi, /(LocalWords:?.*)/g]; +const regExCSpellInDocDirective = /(?:spell-?checker|c?spell)::?(.*)/gi; +const regExCSpellDirectiveKey = /(?<=(?:spell-?checker|c?spell)::?)(?!:)(.*)/i; +const regExInFileSettings = [regExCSpellInDocDirective, /(LocalWords:?.*)/g]; +const officialDirectives = [ + 'enable', + 'disable', + 'disable-line', + 'disable-next', + 'disable-next-line', + 'word', + 'words', + 'ignore', + 'ignoreWord', + 'ignoreWords', + 'includeRegExp', + 'ignoreRegExp', + 'locale', + 'language', + 'dictionaries', + 'enableCompoundWords', + 'enableAllowCompoundWords', + 'disableCompoundWords', + 'disableAllowCompoundWords', + 'enableCaseSensitive', + 'disableCaseSensitive', +]; +const preferredDirectives = [ + 'enable', + 'disable', + 'disable-line', + 'disable-next-line', + 'words', + 'ignore', + 'locale', + 'dictionaries', + 'enableCaseSensitive', + 'disableCaseSensitive', +]; +const allDirectives = new Set(preferredDirectives.concat(officialDirectives)); +const dictInDocSettings = (0, SpellingDictionary_1.createSpellingDictionary)(allDirectives, 'Directives', 'Directive List', { + supportNonStrictSearches: false, +}); const EmptyWords = []; Object.freeze(EmptyWords); function getInDocumentSettings(text) { @@ -43,21 +86,62 @@ function getInDocumentSettings(text) { return settings; } exports.getInDocumentSettings = getInDocumentSettings; +function validateInDocumentSettings(docText, _settings) { + return (0, cspell_pipe_1.pipeSync)(getPossibleInDocSettings(docText), (0, cspell_pipe_1.opMap)(parseSettingMatchValidation), (0, cspell_pipe_1.opFilter)(util_1.isDefined)); +} +exports.validateInDocumentSettings = validateInDocumentSettings; +const settingParsers = [ + [/^(?:enable|disable)(?:allow)?CompoundWords\b/i, parseCompoundWords], + [/^(?:enable|disable)CaseSensitive\b/i, parseCaseSensitive], + [/^enable\b(?!-)/i, parseEnable], + [/^disable(-line|-next(-line)?)?\b(?!-)/i, parseDisable], + [/^words?\s/i, parseWords], + [/^ignore(?:words?)?\s/i, parseIgnoreWords], + [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], + [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], + [/^locale?\s/i, parseLocale], + [/^language\s/i, parseLocale], + [/^dictionaries\s/i, parseDictionaries], + [/^LocalWords:/, (w) => parseWords(w.replace(/LocalWords:?/gi, ' '))], +]; +exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b[\s\S]*?((?:\1\s*enable\b)|$)/gi; +exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; +exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; +const issueMessages = { + unknownDirective: 'Unknown CSpell directive', +}; +function parseSettingMatchValidation(matchArray) { + const [fullMatch = ''] = matchArray; + const directiveMatch = fullMatch.match(regExCSpellDirectiveKey); + if (!directiveMatch) + return undefined; + const match = directiveMatch[1]; + const possibleSetting = match.trim(); + if (!possibleSetting) + return undefined; + const start = (matchArray.index || 0) + (directiveMatch.index || 0) + (match.length - match.trimStart().length); + const text = possibleSetting.replace(/^([-\w]+)?.*/, '$1'); + const end = start + text.length; + if (!text) + return undefined; + const matchingParsers = settingParsers.filter(([regex]) => regex.test(possibleSetting)); + if (matchingParsers.length > 0) + return undefined; + // No matches were found, let make some suggestions. + const dictSugs = dictInDocSettings.suggest(text, { ignoreCase: false }).map((sug) => sug.word); + const sugs = new Set((0, cspell_pipe_1.pipeSync)(dictSugs, (0, cspell_pipe_1.opAppend)(allDirectives))); + const suggestions = [...sugs].slice(0, 8); + const issue = { + range: [start, end], + text, + message: issueMessages.unknownDirective, + suggestions, + }; + return issue; +} function parseSettingMatch(matchArray) { const [, match = ''] = matchArray; const possibleSetting = match.trim(); - const settingParsers = [ - [/^(?:enable|disable)(?:allow)?CompoundWords/i, parseCompoundWords], - [/^(?:enable|disable)CaseSensitive/i, parseCaseSensitive], - [/^words?\s/i, parseWords], - [/^ignore(?:words?)?\s/i, parseIgnoreWords], - [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], - [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], - [/^locale?\s/i, parseLocale], - [/^language\s/i, parseLocale], - [/^dictionaries\s/i, parseDictionaries], - [/^LocalWords:/, (w) => parseWords(w.replace(/LocalWords:?/gi, ' '))], - ]; return settingParsers .filter(([regex]) => regex.test(possibleSetting)) .map(([, fn]) => fn) @@ -113,6 +197,14 @@ function getWordsFromDocument(text) { const { words = EmptyWords } = getInDocumentSettings(text); return words; } +function parseEnable(_match) { + // Do nothing. Enable / Disable is handled in a different way. + return {}; +} +function parseDisable(_match) { + // Do nothing. Enable / Disable is handled in a different way. + return {}; +} function getIgnoreWordsFromDocument(text) { const { ignoreWords = EmptyWords } = getInDocumentSettings(text); return ignoreWords; diff --git a/action/node_modules/cspell-lib/dist/Settings/RegExpPatterns.js b/action/node_modules/cspell-lib/dist/Settings/RegExpPatterns.js index f396ab38c..21aa9e097 100644 --- a/action/node_modules/cspell-lib/dist/Settings/RegExpPatterns.js +++ b/action/node_modules/cspell-lib/dist/Settings/RegExpPatterns.js @@ -12,7 +12,7 @@ exports.regExCStyleHexValue = /\b0x[0-9a-f]+\b/gi; exports.regExCSSHexValue = /#[0-9a-f]{3,8}\b/gi; exports.regExUUID = /\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi; // x - represents placeholder values exports.regExUnicodeRef = /\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi; -exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b[\s\S]*?((?:\1\s*enable\b)|$)/gi; +exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi; exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; exports.regExIgnoreSpellingDirectives = /\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim; diff --git a/action/node_modules/cspell-lib/dist/SpellingDictionary/createSpellingDictionary.js b/action/node_modules/cspell-lib/dist/SpellingDictionary/createSpellingDictionary.js index 6bc591a88..ad70a1c5e 100644 --- a/action/node_modules/cspell-lib/dist/SpellingDictionary/createSpellingDictionary.js +++ b/action/node_modules/cspell-lib/dist/SpellingDictionary/createSpellingDictionary.js @@ -34,7 +34,8 @@ exports.createSpellingDictionary = createSpellingDictionary; function _createSpellingDictionary(params) { const [wordList, name, source, options] = params; // console.log(`createSpellingDictionary ${name} ${source}`); - const words = (0, cspell_trie_lib_1.parseDictionaryLines)(wordList); + const parseOptions = { stripCaseAndAccents: options?.supportNonStrictSearches ?? true }; + const words = (0, cspell_trie_lib_1.parseDictionaryLines)(wordList, parseOptions); const trie = (0, cspell_trie_lib_1.buildTrieFast)(words); const opts = { ...(options || defaultOptions) }; if (opts.weightMap === undefined && opts.dictionaryInformation) { diff --git a/action/node_modules/cspell-lib/dist/index.js b/action/node_modules/cspell-lib/dist/index.js index 19e627699..0cda9a9f4 100644 --- a/action/node_modules/cspell-lib/dist/index.js +++ b/action/node_modules/cspell-lib/dist/index.js @@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Link = exports.Text = exports.validateText = exports.IncludeExcludeFlag = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.SpellingDictionaryCollection = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.isBinaryFile = exports.fileToDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = void 0; +exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Link = exports.Text = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.SpellingDictionaryCollection = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = void 0; const ExclusionHelper = __importStar(require("./exclusionHelper")); exports.ExclusionHelper = ExclusionHelper; const Settings_1 = require("./Settings"); @@ -58,6 +58,7 @@ Object.defineProperty(exports, "constructSettingsForText", { enumerable: true, g var spellCheckFile_1 = require("./spellCheckFile"); Object.defineProperty(exports, "determineFinalDocumentSettings", { enumerable: true, get: function () { return spellCheckFile_1.determineFinalDocumentSettings; } }); Object.defineProperty(exports, "fileToDocument", { enumerable: true, get: function () { return spellCheckFile_1.fileToDocument; } }); +Object.defineProperty(exports, "fileToTextDocument", { enumerable: true, get: function () { return spellCheckFile_1.fileToTextDocument; } }); Object.defineProperty(exports, "isBinaryFile", { enumerable: true, get: function () { return spellCheckFile_1.isBinaryFile; } }); Object.defineProperty(exports, "spellCheckDocument", { enumerable: true, get: function () { return spellCheckFile_1.spellCheckDocument; } }); Object.defineProperty(exports, "spellCheckFile", { enumerable: true, get: function () { return spellCheckFile_1.spellCheckFile; } }); @@ -84,6 +85,7 @@ var resolveFile_1 = require("./util/resolveFile"); Object.defineProperty(exports, "resolveFile", { enumerable: true, get: function () { return resolveFile_1.resolveFile; } }); var validator_1 = require("./validator"); Object.defineProperty(exports, "checkText", { enumerable: true, get: function () { return validator_1.checkText; } }); +Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function () { return validator_1.checkTextDocument; } }); Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return validator_1.IncludeExcludeFlag; } }); Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return validator_1.validateText; } }); async function clearCachedFiles() { diff --git a/action/node_modules/cspell-lib/dist/spellCheckFile.js b/action/node_modules/cspell-lib/dist/spellCheckFile.js index b629a355a..67cf9fe41 100644 --- a/action/node_modules/cspell-lib/dist/spellCheckFile.js +++ b/action/node_modules/cspell-lib/dist/spellCheckFile.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.fileToDocument = exports.isBinaryFile = exports.isBinaryDoc = exports.determineFinalDocumentSettings = exports.spellCheckDocument = exports.spellCheckFile = void 0; +exports.resolveDocumentToTextDocument = exports.fileToTextDocument = exports.fileToDocument = exports.isBinaryFile = exports.isBinaryDoc = exports.determineFinalDocumentSettings = exports.spellCheckDocument = exports.spellCheckFile = void 0; const fs_extra_1 = require("fs-extra"); const vscode_uri_1 = require("vscode-uri"); const LanguageIds_1 = require("./LanguageIds"); @@ -59,8 +59,7 @@ async function spellCheckDocument(document, options, settings) { } exports.spellCheckDocument = spellCheckDocument; async function spellCheckFullDocument(document, options, settings) { - const { uri, text: content, languageId, locale } = document; - const doc = (0, TextDocument_1.createTextDocument)({ uri, content, languageId, locale }); + const doc = documentToTextDocument(document); const docValOptions = options; const docValidator = new textValidation_1.DocumentValidator(doc, docValOptions, settings); await docValidator.prepare(); @@ -159,4 +158,16 @@ function fileToDocument(file, text, languageId, locale) { }); } exports.fileToDocument = fileToDocument; +async function fileToTextDocument(file) { + return documentToTextDocument(await resolveDocument(fileToDocument(file))); +} +exports.fileToTextDocument = fileToTextDocument; +function documentToTextDocument(document) { + const { uri, text: content, languageId, locale } = document; + return (0, TextDocument_1.createTextDocument)({ uri, content, languageId, locale }); +} +async function resolveDocumentToTextDocument(doc) { + return documentToTextDocument(await resolveDocument(doc)); +} +exports.resolveDocumentToTextDocument = resolveDocumentToTextDocument; //# sourceMappingURL=spellCheckFile.js.map \ No newline at end of file diff --git a/action/node_modules/cspell-lib/dist/textValidation/checkText.js b/action/node_modules/cspell-lib/dist/textValidation/checkText.js new file mode 100644 index 000000000..800e207f1 --- /dev/null +++ b/action/node_modules/cspell-lib/dist/textValidation/checkText.js @@ -0,0 +1,152 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.genCheckText = exports.checkTextDocument = exports.IncludeExcludeFlag = exports.checkTextOld = exports.checkText = void 0; +const assert_1 = __importDefault(require("assert")); +const TextDocument_1 = require("../Models/TextDocument"); +const Settings = __importStar(require("../Settings")); +const spellCheckFile_1 = require("../spellCheckFile"); +const util_1 = require("../util/util"); +const docValidator_1 = require("./docValidator"); +const textValidator_1 = require("./textValidator"); +const validator_1 = require("./validator"); +/** + * Annotate text with issues and include / exclude zones. + * @param text - the text to annotate. + * @param settings - the settings to use. + * @returns the Check Text result + * @deprecated + */ +async function checkText(text, settings) { + const doc = (0, util_1.clean)({ + uri: '', + text, + languageId: settings.languageId || 'plaintext', + locale: settings.language, + }); + return checkTextDocument(doc, { noConfigSearch: true }, { loadDefaultConfiguration: false, ...settings }); +} +exports.checkText = checkText; +/** + * Annotate text with issues and include / exclude zones. + * @param text - the text to annotate. + * @param settings - the settings to use. + * @returns the Check Text result + * @deprecated + */ +async function checkTextOld(text, settings) { + const validationResult = (0, validator_1.validateText)(text, settings); + const finalSettings = Settings.finalizeSettings(settings); + const includeRanges = (0, textValidator_1.calcTextInclusionRanges)(text, finalSettings); + const issues = await validationResult; + return genResult(text, issues, includeRanges); +} +exports.checkTextOld = checkTextOld; +var IncludeExcludeFlag; +(function (IncludeExcludeFlag) { + IncludeExcludeFlag["INCLUDE"] = "I"; + IncludeExcludeFlag["EXCLUDE"] = "E"; +})(IncludeExcludeFlag = exports.IncludeExcludeFlag || (exports.IncludeExcludeFlag = {})); +/** + * Calculate document issues and include / exclude zones. + * @param doc - document to check + * @param options - check options + * @param settings - optional settings + * @returns + */ +async function checkTextDocument(doc, options, settings = {}) { + doc = (0, TextDocument_1.isTextDocument)(doc) ? doc : await (0, spellCheckFile_1.resolveDocumentToTextDocument)(doc); + return genCheckText(new docValidator_1.DocumentValidator(doc, options, settings)); +} +exports.checkTextDocument = checkTextDocument; +async function genCheckText(docValidator) { + await docValidator.prepare(); + const issues = docValidator.checkDocument(true); + const preparations = docValidator._getPreparations(); + (0, assert_1.default)(preparations); + return genResult(docValidator.document.text, issues, preparations.includeRanges); +} +exports.genCheckText = genCheckText; +function genResult(text, issues, includeRanges) { + const result = []; + let lastPos = 0; + for (const { startPos, endPos } of includeRanges) { + result.push({ + text: text.slice(lastPos, startPos), + startPos: lastPos, + endPos: startPos, + flagIE: IncludeExcludeFlag.EXCLUDE, + }); + result.push({ + text: text.slice(startPos, endPos), + startPos, + endPos, + flagIE: IncludeExcludeFlag.INCLUDE, + }); + lastPos = endPos; + } + result.push({ + text: text.slice(lastPos), + startPos: lastPos, + endPos: text.length, + flagIE: IncludeExcludeFlag.EXCLUDE, + }); + function* merge() { + let i = 0; + for (const r of result) { + if (i >= issues.length || issues[i].offset >= r.endPos) { + yield r; + continue; + } + const span = { ...r }; + while (i < issues.length && issues[i].offset < span.endPos) { + const issue = issues[i]; + const endPos = issue.offset; + const text = span.text.slice(0, endPos - span.startPos); + const endPosError = issue.offset + issue.text.length; + yield { ...span, text, endPos }; + yield { + ...span, + isError: true, + startPos: issue.offset, + endPos: endPosError, + text: issue.text, + }; + span.text = span.text.slice(endPosError - span.startPos); + span.startPos = endPosError; + i += 1; + } + yield span; + } + } + return { + text, + items: [...merge()].filter((i) => i.startPos < i.endPos), + }; +} +//# sourceMappingURL=checkText.js.map \ No newline at end of file diff --git a/action/node_modules/cspell-lib/dist/textValidation/docValidator.js b/action/node_modules/cspell-lib/dist/textValidation/docValidator.js index 4718c60ef..585c034e8 100644 --- a/action/node_modules/cspell-lib/dist/textValidation/docValidator.js +++ b/action/node_modules/cspell-lib/dist/textValidation/docValidator.js @@ -5,11 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentValidator = void 0; const cspell_pipe_1 = require("@cspell/cspell-pipe"); +const cspell_types_1 = require("@cspell/cspell-types"); const assert_1 = __importDefault(require("assert")); const cspell_glob_1 = require("cspell-glob"); const TextDocument_1 = require("../Models/TextDocument"); const Settings_1 = require("../Settings"); const configLoader_1 = require("../Settings/Controller/configLoader"); +const InDocSettings_1 = require("../Settings/InDocSettings"); const SpellingDictionary_1 = require("../SpellingDictionary"); const errors_1 = require("../util/errors"); const Memorizer_1 = require("../util/Memorizer"); @@ -162,6 +164,9 @@ class DocumentValidator { get prepTime() { return this._preparationTime; } + get validateDirectives() { + return this.options.validateDirectives ?? this._preparations?.config.validateDirectives ?? false; + } checkText(range, _text, scope) { const text = this._document.text.slice(range[0], range[1]); return this.check({ text, range, scope: scope.join(' ') }); @@ -197,10 +202,47 @@ class DocumentValidator { }); return withSugs; } + /** + * Check a Document for Validation Issues. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ + async checkDocumentAsync(forceCheck) { + await this.prepare(); + return this.checkDocument(forceCheck); + } + /** + * Check a Document for Validation Issues. + * + * Note: The validator must be prepared before calling this method. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ checkDocument(forceCheck = false) { (0, assert_1.default)(this._ready); (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - return forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; + const spellingIssues = forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; + const directiveIssues = this.checkDocumentDirectives(); + const allIssues = spellingIssues.concat(directiveIssues).sort((a, b) => a.offset - b.offset); + return allIssues; + } + checkDocumentDirectives(forceCheck = false) { + (0, assert_1.default)(this._ready); + (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); + const validateDirectives = forceCheck || this.validateDirectives; + if (!validateDirectives) + return []; + const document = this.document; + const issueType = cspell_types_1.IssueType.directive; + function toValidationIssue(dirIssue) { + const { text, range, suggestions, message } = dirIssue; + const offset = range[0]; + const pos = document.positionAt(offset); + const line = document.getLine(pos.line); + const issue = { text, offset, line, suggestions, message, issueType }; + return issue; + } + return [...(0, InDocSettings_1.validateInDocumentSettings)(this.document.text, this._preparations.config)].map(toValidationIssue); } get document() { return this._document; diff --git a/action/node_modules/cspell-lib/dist/textValidation/index.js b/action/node_modules/cspell-lib/dist/textValidation/index.js index 3f89f7547..61204cb22 100644 --- a/action/node_modules/cspell-lib/dist/textValidation/index.js +++ b/action/node_modules/cspell-lib/dist/textValidation/index.js @@ -1,12 +1,14 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.DocumentValidator = exports.validateText = exports.IncludeExcludeFlag = exports.checkText = exports.calcTextInclusionRanges = void 0; +exports.validateText = exports.calcTextInclusionRanges = exports.DocumentValidator = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; +var checkText_1 = require("./checkText"); +Object.defineProperty(exports, "checkText", { enumerable: true, get: function () { return checkText_1.checkText; } }); +Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function () { return checkText_1.checkTextDocument; } }); +Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return checkText_1.IncludeExcludeFlag; } }); +var docValidator_1 = require("./docValidator"); +Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function () { return docValidator_1.DocumentValidator; } }); var textValidator_1 = require("./textValidator"); Object.defineProperty(exports, "calcTextInclusionRanges", { enumerable: true, get: function () { return textValidator_1.calcTextInclusionRanges; } }); var validator_1 = require("./validator"); -Object.defineProperty(exports, "checkText", { enumerable: true, get: function () { return validator_1.checkText; } }); -Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return validator_1.IncludeExcludeFlag; } }); Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return validator_1.validateText; } }); -var docValidator_1 = require("./docValidator"); -Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function () { return docValidator_1.DocumentValidator; } }); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/action/node_modules/cspell-lib/dist/textValidation/validator.js b/action/node_modules/cspell-lib/dist/textValidation/validator.js index ecdfe4330..106cd8e59 100644 --- a/action/node_modules/cspell-lib/dist/textValidation/validator.js +++ b/action/node_modules/cspell-lib/dist/textValidation/validator.js @@ -23,8 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkText = exports.IncludeExcludeFlag = exports.settingsToValidateOptions = exports.validateText = exports.diagSource = void 0; +exports.settingsToValidateOptions = exports.validateText = exports.diagSource = void 0; +const cspell_types_1 = require("@cspell/cspell-types"); +const TextDocument_1 = require("../Models/TextDocument"); const Settings = __importStar(require("../Settings")); +const InDocSettings_1 = require("../Settings/InDocSettings"); const SpellingDictionary_1 = require("../SpellingDictionary"); const Memorizer_1 = require("../util/Memorizer"); const util_1 = require("../util/util"); @@ -37,7 +40,11 @@ exports.diagSource = 'cSpell Checker'; async function validateText(text, settings, options = {}) { const finalSettings = Settings.finalizeSettings(settings); const dict = await (0, SpellingDictionary_1.getDictionaryInternal)(finalSettings); - const issues = [...(0, textValidator_1.validateText)(text, dict, settingsToValidateOptions(finalSettings))]; + const spellingIssues = [...(0, textValidator_1.validateText)(text, dict, settingsToValidateOptions(finalSettings))]; + const validationIssues = options.validateDirectives || finalSettings.validateDirectives + ? (0, InDocSettings_1.validateInDocumentSettings)(text, settings) + : []; + const issues = spellingIssues.concat(mapValidationIssues(text, validationIssues)); if (!options.generateSuggestions) { return issues; } @@ -58,6 +65,22 @@ async function validateText(text, settings, options = {}) { return withSugs; } exports.validateText = validateText; +function mapValidationIssues(text, valIssues) { + const issues = [...valIssues]; + if (!issues.length) + return []; + const document = (0, TextDocument_1.createTextDocument)({ uri: '', content: text }); + const issueType = cspell_types_1.IssueType.directive; + function toValidationIssue(dirIssue) { + const { text, range, suggestions, message } = dirIssue; + const offset = range[0]; + const pos = document.positionAt(offset); + const line = document.getLine(pos.line); + const issue = { text, offset, line, suggestions, message, issueType }; + return issue; + } + return issues.map(toValidationIssue); +} function settingsToValidateOptions(settings) { const opt = { ...settings, @@ -66,71 +89,4 @@ function settingsToValidateOptions(settings) { return opt; } exports.settingsToValidateOptions = settingsToValidateOptions; -var IncludeExcludeFlag; -(function (IncludeExcludeFlag) { - IncludeExcludeFlag["INCLUDE"] = "I"; - IncludeExcludeFlag["EXCLUDE"] = "E"; -})(IncludeExcludeFlag = exports.IncludeExcludeFlag || (exports.IncludeExcludeFlag = {})); -async function checkText(text, settings) { - const validationResult = validateText(text, settings); - const finalSettings = Settings.finalizeSettings(settings); - const includeRanges = (0, textValidator_1.calcTextInclusionRanges)(text, finalSettings); - const result = []; - let lastPos = 0; - for (const { startPos, endPos } of includeRanges) { - result.push({ - text: text.slice(lastPos, startPos), - startPos: lastPos, - endPos: startPos, - flagIE: IncludeExcludeFlag.EXCLUDE, - }); - result.push({ - text: text.slice(startPos, endPos), - startPos, - endPos, - flagIE: IncludeExcludeFlag.INCLUDE, - }); - lastPos = endPos; - } - result.push({ - text: text.slice(lastPos), - startPos: lastPos, - endPos: text.length, - flagIE: IncludeExcludeFlag.EXCLUDE, - }); - const issues = await validationResult; - function* merge() { - let i = 0; - for (const r of result) { - if (i >= issues.length || issues[i].offset >= r.endPos) { - yield r; - continue; - } - const span = { ...r }; - while (i < issues.length && issues[i].offset < span.endPos) { - const issue = issues[i]; - const endPos = issue.offset; - const text = span.text.slice(0, endPos - span.startPos); - const endPosError = issue.offset + issue.text.length; - yield { ...span, text, endPos }; - yield { - ...span, - isError: true, - startPos: issue.offset, - endPos: endPosError, - text: issue.text, - }; - span.text = span.text.slice(endPosError - span.startPos); - span.startPos = endPosError; - i += 1; - } - yield span; - } - } - return { - text, - items: [...merge()].filter((i) => i.startPos < i.endPos), - }; -} -exports.checkText = checkText; //# sourceMappingURL=validator.js.map \ No newline at end of file diff --git a/action/node_modules/cspell-lib/dist/validator.js b/action/node_modules/cspell-lib/dist/validator.js index 781172fed..7161e2a81 100644 --- a/action/node_modules/cspell-lib/dist/validator.js +++ b/action/node_modules/cspell-lib/dist/validator.js @@ -1,8 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateText = exports.IncludeExcludeFlag = exports.checkText = void 0; +exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; var textValidation_1 = require("./textValidation"); Object.defineProperty(exports, "checkText", { enumerable: true, get: function () { return textValidation_1.checkText; } }); +Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function () { return textValidation_1.checkTextDocument; } }); Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function () { return textValidation_1.IncludeExcludeFlag; } }); Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return textValidation_1.validateText; } }); //# sourceMappingURL=validator.js.map \ No newline at end of file diff --git a/action/node_modules/cspell-lib/package.json b/action/node_modules/cspell-lib/package.json index f02a901d1..0300a1448 100644 --- a/action/node_modules/cspell-lib/package.json +++ b/action/node_modules/cspell-lib/package.json @@ -1,6 +1,6 @@ { "name": "cspell-lib", - "version": "6.7.0", + "version": "6.8.0", "description": "A library of useful functions used across various cspell tools.", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -48,17 +48,17 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell#readme", "dependencies": { - "@cspell/cspell-bundled-dicts": "^6.7.0", - "@cspell/cspell-pipe": "^6.7.0", - "@cspell/cspell-types": "^6.7.0", + "@cspell/cspell-bundled-dicts": "^6.8.0", + "@cspell/cspell-pipe": "^6.8.0", + "@cspell/cspell-types": "^6.8.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^5.0.1", "cosmiconfig": "^7.0.1", - "cspell-glob": "^6.7.0", - "cspell-grammar": "^6.7.0", - "cspell-io": "^6.7.0", - "cspell-trie-lib": "^6.7.0", + "cspell-glob": "^6.8.0", + "cspell-grammar": "^6.8.0", + "cspell-io": "^6.8.0", + "cspell-trie-lib": "^6.8.0", "fast-equals": "^4.0.1", "find-up": "^5.0.0", "fs-extra": "^10.1.0", @@ -77,21 +77,21 @@ "@cspell/dict-csharp": "^3.0.1", "@cspell/dict-css": "^1.0.13", "@cspell/dict-fa-ir": "^2.0.0", - "@cspell/dict-fr-fr": "^2.1.0", + "@cspell/dict-fr-fr": "^2.1.1", "@cspell/dict-html": "^1.1.9", - "@cspell/dict-nl-nl": "^2.2.5", + "@cspell/dict-nl-nl": "^2.2.6", "@cspell/dict-python": "^2.0.6", "@types/configstore": "^5.0.1", "@types/fs-extra": "^9.0.13", "@types/jest": "^28.1.7", - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "cspell-dict-nl-nl": "^1.1.2", "jest": "^28.1.3", "lorem-ipsum": "^2.0.8", "rimraf": "^3.0.2", - "rollup": "^2.78.0", + "rollup": "^2.78.1", "rollup-plugin-dts": "^4.2.2", "ts-jest": "^28.0.8" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell-trie-lib/package.json b/action/node_modules/cspell-trie-lib/package.json index 038a5ea49..545c3f8f2 100644 --- a/action/node_modules/cspell-trie-lib/package.json +++ b/action/node_modules/cspell-trie-lib/package.json @@ -1,6 +1,6 @@ { "name": "cspell-trie-lib", - "version": "6.7.0", + "version": "6.8.0", "description": "Trie Data Structure to support cspell.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -37,8 +37,8 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell#readme", "dependencies": { - "@cspell/cspell-pipe": "^6.7.0", - "@cspell/cspell-types": "^6.7.0", + "@cspell/cspell-pipe": "^6.8.0", + "@cspell/cspell-types": "^6.8.0", "fs-extra": "^10.1.0", "gensequence": "^3.1.1" }, @@ -46,12 +46,12 @@ "node": ">=14" }, "devDependencies": { - "@cspell/dict-en_us": "^2.3.1", - "@cspell/dict-es-es": "^2.2.0", + "@cspell/dict-en_us": "^2.3.2", + "@cspell/dict-es-es": "^2.2.1", "@types/fs-extra": "^9.0.13", - "@types/node": "^18.7.6", + "@types/node": "^18.7.8", "jest": "^28.1.3", "rimraf": "^3.0.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/node_modules/cspell/dist/application.js b/action/node_modules/cspell/dist/application.js index ea9973f6e..5ee05889e 100644 --- a/action/node_modules/cspell/dist/application.js +++ b/action/node_modules/cspell/dist/application.js @@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createInit = exports.suggestions = exports.checkText = exports.trace = exports.lint = exports.IncludeExcludeFlag = void 0; const cspell_pipe_1 = require("@cspell/cspell-pipe"); const cspell_lib_1 = require("cspell-lib"); -const path = __importStar(require("path")); const cli_reporter_1 = require("./cli-reporter"); const lint_1 = require("./lint"); const options_1 = require("./options"); @@ -55,15 +54,19 @@ async function* trace(words, options) { exports.trace = trace; async function checkText(filename, options) { options = (0, options_1.fixLegacy)(options); - const pSettings = (0, fileHelper_1.readConfig)(options.config, path.dirname(filename)); - const [foundSettings, text] = await Promise.all([pSettings, (0, fileHelper_1.readFile)(filename)]); + const fileInfo = await (0, fileHelper_1.readFileInfo)(filename); + const { locale, languageId, validateDirectives } = options; + const doc = (0, fileHelper_1.fileInfoToDocument)(fileInfo, languageId, locale); + const checkOptions = { + configFile: options.config, + validateDirectives, + }; const settingsFromCommandLine = util.clean({ - languageId: options.languageId || undefined, - language: options.locale || options.local || undefined, + languageId, + language: locale, loadDefaultConfiguration: options.defaultConfiguration, }); - const info = (0, fileHelper_1.calcFinalConfigInfo)(foundSettings, settingsFromCommandLine, filename, text); - return (0, cspell_lib_1.checkText)(text, info.configInfo.config); + return (0, cspell_lib_1.checkTextDocument)(doc, checkOptions, settingsFromCommandLine); } exports.checkText = checkText; async function* suggestions(words, options) { diff --git a/action/node_modules/cspell/dist/cli-reporter.js b/action/node_modules/cspell/dist/cli-reporter.js index 6d8ed6f08..56d2831b7 100644 --- a/action/node_modules/cspell/dist/cli-reporter.js +++ b/action/node_modules/cspell/dist/cli-reporter.js @@ -164,7 +164,8 @@ function formatIssue(templateStr, issue, maxIssueTextWidth) { const colText = col.toString(); const padRowCol = ' '.repeat(Math.max(1, 8 - (rowText.length + colText.length))); const suggestions = issue.suggestions?.join(', ') || ''; - const message = issue.isFlagged ? '{yellow Forbidden word}' : 'Unknown word'; + const msg = issue.message || (issue.isFlagged ? 'Forbidden word' : 'Unknown word'); + const message = issue.isFlagged ? `{yellow ${msg}}` : msg; const substitutions = { $col: colText, $contextFull: contextFull, diff --git a/action/node_modules/cspell/dist/commandCheck.js b/action/node_modules/cspell/dist/commandCheck.js index 57cbe6f96..7109b449c 100644 --- a/action/node_modules/cspell/dist/commandCheck.js +++ b/action/node_modules/cspell/dist/commandCheck.js @@ -34,6 +34,8 @@ function commandCheck(prog) { .command('check ') .description('Spell check file(s) and display the result. The full file is displayed in color.') .option('-c, --config ', 'Configuration file to use. By default cspell looks for cspell.json in the current directory.') + .option('--validate-directives', 'Validate in-document CSpell directives.') + .option('--no-validate-directives', 'Do not validate in-document CSpell directives.') .option('--no-color', 'Turn off color.') .option('--color', 'Force color') .addOption(new commander_1.Option('--default-configuration', 'Load the default configuration and dictionaries.').hideHelp()) diff --git a/action/node_modules/cspell/dist/commandLint.js b/action/node_modules/cspell/dist/commandLint.js index f98c98663..ce347d410 100644 --- a/action/node_modules/cspell/dist/commandLint.js +++ b/action/node_modules/cspell/dist/commandLint.js @@ -90,6 +90,8 @@ function commandLint(prog) { .option('--gitignore', 'Ignore files matching glob patterns found in .gitignore files.') .option('--no-gitignore', 'Do NOT use .gitignore files.') .option('--gitignore-root ', 'Prevent searching for .gitignore files past root.', collect) + .option('--validate-directives', 'Validate in-document CSpell directives.') + .option('--no-validate-directives', 'Do not validate in-document CSpell directives.') .option('--no-color', 'Turn off color.') .option('--color', 'Force color.') .addOption(new commander_1.Option('--default-configuration', 'Load the default configuration and dictionaries.').hideHelp()) diff --git a/action/node_modules/cspell/dist/lint/lint.js b/action/node_modules/cspell/dist/lint/lint.js index 0b8ac55c3..d1ffed2a4 100644 --- a/action/node_modules/cspell/dist/lint/lint.js +++ b/action/node_modules/cspell/dist/lint/lint.js @@ -83,7 +83,8 @@ async function runLint(cfg) { let spellResult = {}; reporter.info(`Checking: ${filename}, File type: ${doc.languageId ?? 'auto'}, Language: ${doc.locale ?? 'default'}`, cspell_types_1.MessageTypes.Info); try { - const validateOptions = { generateSuggestions: cfg.options.showSuggestions, numSuggestions: 5 }; + const { showSuggestions: generateSuggestions, validateDirectives } = cfg.options; + const validateOptions = { generateSuggestions, numSuggestions: 5, validateDirectives }; const r = await cspell.spellCheckDocument(doc, validateOptions, configInfo.config); spellResult = r; result.processed = r.checked; @@ -125,9 +126,6 @@ async function runLint(cfg) { const fileCount = files instanceof Array ? files.length : undefined; const status = runResult(); const cache = (0, cache_1.createCache)(cacheSettings); - if (cfg.options.cacheReset) { - cache.reset(); - } const failFast = cfg.options.failFast ?? configInfo.config.failFast ?? false; const emitProgressBegin = (filename, fileNum, fileCount) => reporter.progress({ type: 'ProgressFileBegin', diff --git a/action/node_modules/cspell/dist/util/cache/DiskCache.js b/action/node_modules/cspell/dist/util/cache/DiskCache.js index dab228029..79cfe327d 100644 --- a/action/node_modules/cspell/dist/util/cache/DiskCache.js +++ b/action/node_modules/cspell/dist/util/cache/DiskCache.js @@ -22,13 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.__testing__ = exports.DiskCache = void 0; +const assert_1 = __importDefault(require("assert")); const crypto = __importStar(require("crypto")); -const fileEntryCache = __importStar(require("file-entry-cache")); const fs = __importStar(require("fs")); const path_1 = require("path"); const fileHelper_1 = require("../../util/fileHelper"); +const fileEntryCache_1 = require("./fileEntryCache"); const ObjectCollection_1 = require("./ObjectCollection"); const cacheDataKeys = { v: 'v', @@ -45,17 +49,21 @@ const META_DATA_VERSION_SUFFIX = '-' + META_DATA_BASE_VERSION + '-' + Object.key * Caches cspell results on disk */ class DiskCache { - constructor(cacheFileLocation, useCheckSum, cspellVersion) { + constructor(cacheFileLocation, useCheckSum, cspellVersion, useUniversalCache) { this.useCheckSum = useCheckSum; this.cspellVersion = cspellVersion; + this.useUniversalCache = useUniversalCache; this.dependencyCache = new Map(); this.dependencyCacheTree = {}; this.objectCollection = new ObjectCollection_1.ShallowObjectCollection(); this.ocCacheFileResult = new ObjectCollection_1.ShallowObjectCollection(); - this.fileEntryCache = fileEntryCache.createFromFile((0, path_1.resolve)(cacheFileLocation), useCheckSum); + this.cacheFileLocation = (0, path_1.resolve)(cacheFileLocation); + this.cacheDir = (0, path_1.dirname)(this.cacheFileLocation); + this.fileEntryCache = (0, fileEntryCache_1.createFromFile)(this.cacheFileLocation, useCheckSum, useUniversalCache); this.version = calcVersion(cspellVersion); } async getCachedLintResults(filename) { + filename = (0, fileEntryCache_1.normalizePath)(filename); const fileDescriptor = this.fileEntryCache.getFileDescriptor(filename); const meta = fileDescriptor.meta; const data = meta?.data; @@ -131,17 +139,18 @@ class DiskCache { return setTreeEntry(this.dependencyCacheTree, dependencies); } checkDependency(dep) { - const cDep = this.dependencyCache.get(dep.f); + const depFile = this.resolveFile(dep.f); + const cDep = this.dependencyCache.get(depFile); if (cDep && compDep(dep, cDep)) return true; if (cDep) return false; - const d = this.getFileDep(dep.f); + const d = this.getFileDep(depFile); if (compDep(dep, d)) { - this.dependencyCache.set(dep.f, dep); + this.dependencyCache.set(depFile, dep); return true; } - this.dependencyCache.set(d.f, d); + this.dependencyCache.set(depFile, d); return false; } getDependency(file) { @@ -153,15 +162,17 @@ class DiskCache { return d; } getFileDep(file) { + (0, assert_1.default)((0, path_1.isAbsolute)(file)); + const f = this.toRelFile(file); let h; try { const buffer = fs.readFileSync(file); h = this.getHash(buffer); } catch (e) { - return { f: file }; + return { f }; } - return { f: file, h }; + return { f, h }; } checkDependencies(dependencies) { if (!dependencies) @@ -176,6 +187,12 @@ class DiskCache { getHash(buffer) { return crypto.createHash('md5').update(buffer).digest('hex'); } + resolveFile(file) { + return (0, fileEntryCache_1.normalizePath)((0, path_1.resolve)(this.cacheDir, file)); + } + toRelFile(file) { + return (0, fileEntryCache_1.normalizePath)(this.useUniversalCache ? (0, path_1.relative)(this.cacheDir, file) : file); + } } exports.DiskCache = DiskCache; function getTreeEntry(tree, keys) { diff --git a/action/node_modules/cspell/dist/util/cache/createCache.js b/action/node_modules/cspell/dist/util/cache/createCache.js index 7d05a30ca..9cfb4ff5b 100644 --- a/action/node_modules/cspell/dist/util/cache/createCache.js +++ b/action/node_modules/cspell/dist/util/cache/createCache.js @@ -17,10 +17,14 @@ const versionSuffix = ''; * Creates CSpellLintResultCache (disk cache if caching is enabled in config or dummy otherwise) */ function createCache(options) { - const { useCache, cacheLocation, cacheStrategy } = options; - return useCache - ? new DiskCache_1.DiskCache(path_1.default.resolve(cacheLocation), cacheStrategy === 'content', normalizeVersion(options.version)) - : new DummyCache_1.DummyCache(); + const { useCache, cacheLocation, cacheStrategy, reset } = options; + const location = path_1.default.resolve(cacheLocation); + const useChecksum = cacheStrategy === 'content'; + const version = normalizeVersion(options.version); + const useUniversal = options.cacheFormat === 'universal'; + const cache = useCache ? new DiskCache_1.DiskCache(location, useChecksum, version, useUniversal) : new DummyCache_1.DummyCache(); + reset && cache.reset(); + return cache; } exports.createCache = createCache; async function calcCacheSettings(config, cacheOptions, root) { @@ -28,11 +32,17 @@ async function calcCacheSettings(config, cacheOptions, root) { const useCache = cacheOptions.cache ?? cs.useCache ?? false; const cacheLocation = await resolveCacheLocation(path_1.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? exports.DEFAULT_CACHE_LOCATION)); const cacheStrategy = cacheOptions.cacheStrategy ?? cs.cacheStrategy ?? 'metadata'; + const optionals = {}; + if (cacheOptions.cacheReset) { + optionals.reset = true; + } return { + ...optionals, useCache, cacheLocation, cacheStrategy, version: cacheOptions.version, + cacheFormat: cacheOptions.cacheFormat || 'legacy', }; } exports.calcCacheSettings = calcCacheSettings; diff --git a/action/node_modules/cspell/dist/util/cache/fileEntryCache.js b/action/node_modules/cspell/dist/util/cache/fileEntryCache.js new file mode 100644 index 000000000..317d5aacd --- /dev/null +++ b/action/node_modules/cspell/dist/util/cache/fileEntryCache.js @@ -0,0 +1,106 @@ +"use strict"; +/** + * This is a wrapper for 'file-entry-cache' + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizePath = exports.createFromFile = void 0; +const file_entry_cache = __importStar(require("file-entry-cache")); +const path = __importStar(require("path")); +const fs = __importStar(require("fs-extra")); +function createFromFile(pathToCache, useCheckSum, useRelative) { + const absPathToCache = path.resolve(pathToCache); + const relDir = path.dirname(absPathToCache); + fs.mkdirpSync(relDir); + const create = wrap(() => file_entry_cache.createFromFile(absPathToCache, useCheckSum)); + const feCache = create(); + const cacheWrapper = { + get cache() { + return feCache.cache; + }, + getHash(buffer) { + return feCache.getHash(buffer); + }, + hasFileChanged: wrap((cwd, file) => { + console.log(file); + return feCache.hasFileChanged(resolveFile(cwd, file)); + }), + analyzeFiles: wrap((cwd, files) => { + return feCache.analyzeFiles(resolveFiles(cwd, files)); + }), + getFileDescriptor: wrap((cwd, file) => { + return feCache.getFileDescriptor(resolveFile(cwd, file)); + }), + getUpdatedFiles: wrap((cwd, files) => { + return feCache.getUpdatedFiles(resolveFiles(cwd, files)); + }), + normalizeEntries: wrap((cwd, files) => { + return feCache.normalizeEntries(resolveFiles(cwd, files)); + }), + removeEntry: wrap((cwd, file) => { + console.log(file); + return feCache.removeEntry(resolveFile(cwd, file)); + }), + deleteCacheFile() { + feCache.deleteCacheFile(); + }, + destroy() { + feCache.destroy(); + }, + reconcile: wrap((_cwd, noPrune) => { + feCache.reconcile(noPrune); + }), + }; + return cacheWrapper; + function resolveFile(cwd, file) { + if (!useRelative) + return file; + const r = path.relative(relDir, path.resolve(cwd, file)); + return normalizePath(r); + } + function resolveFiles(cwd, files) { + return files?.map((file) => resolveFile(cwd, file)); + } + function wrap(fn) { + return (...params) => { + const cwd = process.cwd(); + try { + process.chdir(relDir); + return fn(cwd, ...params); + } + finally { + process.chdir(cwd); + } + }; + } +} +exports.createFromFile = createFromFile; +function normalizePath(filePath) { + return filePath; + // if (path.sep !== '\\') return filePath; + // return filePath.replace(/\\/g, '/'); +} +exports.normalizePath = normalizePath; +//# sourceMappingURL=fileEntryCache.js.map \ No newline at end of file diff --git a/action/node_modules/cspell/dist/util/fileHelper.js b/action/node_modules/cspell/dist/util/fileHelper.js index 4df371912..1f660c4ed 100644 --- a/action/node_modules/cspell/dist/util/fileHelper.js +++ b/action/node_modules/cspell/dist/util/fileHelper.js @@ -63,6 +63,7 @@ function fileInfoToDocument(fileInfo, languageId, locale) { } exports.fileInfoToDocument = fileInfoToDocument; function readFileInfo(filename, encoding = UTF8, handleNotFound = false) { + filename = filename !== STDIN ? path.resolve(filename) : filename; const pText = filename === STDIN ? (0, get_stdin_1.default)() : fs_1.promises.readFile(filename, encoding); return pText.then((text) => ({ text, filename }), (e) => { const error = (0, errors_1.toError)(e); diff --git a/action/node_modules/cspell/package.json b/action/node_modules/cspell/package.json index d4bfd01b1..7ecea6676 100644 --- a/action/node_modules/cspell/package.json +++ b/action/node_modules/cspell/package.json @@ -1,6 +1,6 @@ { "name": "cspell", - "version": "6.7.0", + "version": "6.8.0", "description": "A Spelling Checker for Code!", "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1", "main": "dist/index.js", @@ -70,12 +70,12 @@ }, "homepage": "https://streetsidesoftware.github.io/cspell/", "dependencies": { - "@cspell/cspell-pipe": "^6.7.0", + "@cspell/cspell-pipe": "^6.8.0", "chalk": "^4.1.2", "commander": "^9.4.0", - "cspell-gitignore": "^6.7.0", - "cspell-glob": "^6.7.0", - "cspell-lib": "^6.7.0", + "cspell-gitignore": "^6.8.0", + "cspell-glob": "^6.8.0", + "cspell-lib": "^6.8.0", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^6.0.1", "fs-extra": "^10.1.0", @@ -90,8 +90,8 @@ "node": ">=14" }, "devDependencies": { - "@cspell/cspell-json-reporter": "^6.7.0", - "@cspell/cspell-types": "^6.7.0", + "@cspell/cspell-json-reporter": "^6.8.0", + "@cspell/cspell-types": "^6.8.0", "@types/file-entry-cache": "^5.0.2", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", @@ -103,8 +103,8 @@ "micromatch": "^4.0.5", "minimatch": "^5.1.0", "rimraf": "^3.0.2", - "rollup": "^2.78.0", + "rollup": "^2.78.1", "rollup-plugin-dts": "^4.2.2" }, - "gitHead": "3a7312a15d2df1507d9e01863ec5842f5a99e0cc" + "gitHead": "8a1bd03222ffc9776c2cdd09180db6150abb3f25" } diff --git a/action/package.json b/action/package.json index f06d003b3..ac3e3f869 100644 --- a/action/package.json +++ b/action/package.json @@ -14,8 +14,8 @@ "@octokit/core": "^4.0.5", "@octokit/plugin-rest-endpoint-methods": "^6.3.0", "@octokit/rest": "^19.0.4", - "cspell": "^6.7.0", - "cspell-glob": "^6.7.0", + "cspell": "^6.8.0", + "cspell-glob": "^6.8.0", "vscode-uri": "^3.0.3" } } diff --git a/yarn.lock b/yarn.lock index 0548f5c7f..7ff3c939a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -315,10 +315,10 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspell/cspell-bundled-dicts@^6.7.0": - version "6.7.0" - resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-6.7.0.tgz#a90feddc2b4516a9cc744f1c4aa17bba6490457c" - integrity sha512-PrN1riHfRBPMPv2oCiNwv9YAUjeyvhYFWgJuY5cE/GWtTcrCmcqjbBJQcAiJd0qQ8hm/cgPdKqOkMtWkm5beTQ== +"@cspell/cspell-bundled-dicts@^6.8.0": + version "6.8.0" + resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-6.8.0.tgz#a0e68ec15fe64576c3bc0f42b36a0117e1fee82e" + integrity sha512-a+J/5M45RUmDiVmzQm8WacZCQxmIq0PK5rgkDE3iWyyIQWPwSK1+C37+85lZoDJ66il4YJpF0jutYKEJNfTCWw== dependencies: "@cspell/dict-ada" "^2.0.1" "@cspell/dict-aws" "^2.0.0" @@ -334,14 +334,14 @@ "@cspell/dict-dotnet" "^2.0.1" "@cspell/dict-elixir" "^2.0.1" "@cspell/dict-en-gb" "^1.1.33" - "@cspell/dict-en_us" "^2.3.1" + "@cspell/dict-en_us" "^2.3.2" "@cspell/dict-filetypes" "^2.1.1" "@cspell/dict-fonts" "^2.0.1" "@cspell/dict-fullstack" "^2.0.6" "@cspell/dict-git" "^1.0.1" "@cspell/dict-golang" "^3.0.1" "@cspell/dict-haskell" "^2.0.1" - "@cspell/dict-html" "^3.0.4" + "@cspell/dict-html" "^3.0.5" "@cspell/dict-html-symbol-entities" "^3.0.0" "@cspell/dict-java" "^3.0.7" "@cspell/dict-latex" "^2.0.9" @@ -363,20 +363,20 @@ "@cspell/dict-typescript" "^2.0.1" "@cspell/dict-vue" "^2.0.2" -"@cspell/cspell-pipe@^6.7.0": - version "6.7.0" - resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-6.7.0.tgz#e3362157f9ca1783a62dc91b80d0a56eca94bdba" - integrity sha512-IpcKK/pRiFasMduf1Cuz20RD0ut+y74msNvDxs/mXBgx0LikVXnt1IF2b/L5j68KNdJqrNc8Uw3pte9fzrn8ZQ== +"@cspell/cspell-pipe@^6.8.0": + version "6.8.0" + resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-6.8.0.tgz#1ade076d5eb21493729548c30ac0c75d94a7c8c3" + integrity sha512-V+GOhpd99Vsa3W30p3jyJ4qNTwEBA04POINT4XZKjuNZ5NLbBO3wARX8cCaVaPB/aJTbaB6rqvXnfTx5h47N0g== -"@cspell/cspell-service-bus@^6.7.0": - version "6.7.0" - resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-6.7.0.tgz#a9d96f2bc5cebbcb9ab6741122df1237c5d61443" - integrity sha512-oCqIbh56mvUNcw4eX2wEXl5c3AIo8T9NM5byxP3uNswn9+1d49Zqpp0EJ4Qy71Lr94/E9uDR1bgDoK5F3nlC3g== +"@cspell/cspell-service-bus@^6.8.0": + version "6.8.0" + resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-6.8.0.tgz#6a307a7da01d226abd93d75b51089edfb9f306f9" + integrity sha512-+3uHHhy1jP+ZYhoDlIbAR5sp6kTlbLctvpPne9KEOFB5Vtnn2a0jfop7Xyfg+BQnEFU/gifoS87sofULBngAxQ== -"@cspell/cspell-types@^6.7.0": - version "6.7.0" - resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-6.7.0.tgz#50e3acecea1b49621894d67f3ee285f21ea36558" - integrity sha512-oZ46iL2/Sgb1tFhxF6FmVMpiK3jhN6IUQzTD96EZ6RN/bWP+D+iC1qmVruYoYc3hSaD8vJKd7lCisdgBKsFmiA== +"@cspell/cspell-types@^6.8.0": + version "6.8.0" + resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-6.8.0.tgz#8bc5dbd8e43bfbb8de5b0b936f8cde5b8c5f9cff" + integrity sha512-5hYe1wXHphVAWaQROJVs67AFMpYW9qNXiNKWdBZ6/l85x5ORcGYBtuxbBjdwzTSCmO6bNGVjYx14gxjQDYLlfQ== "@cspell/dict-ada@^2.0.1": version "2.0.1" @@ -448,7 +448,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^2.3.1": +"@cspell/dict-en_us@^2.3.2": version "2.3.2" resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-2.3.2.tgz#18d2b7d83028b42feea97f8826431fafc1a0d2da" integrity sha512-/jkx3Lwig34nDP8zMEP8IF7Nkni4ac63FlAeK/B4yvriaz7Pqe5XbwU20otlB+y+T0nf5GxvWacIEyTFnV9BKg== @@ -488,7 +488,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-3.0.0.tgz#55d5d96c37ecbde00492c4238e229908eea9cedb" integrity sha512-04K7cPTcbYXmHICfiob4gZA1yaj4hpfM+Nl5WIJ1EAZsSGHdqmGEF28GuCjyQ8ZeKiJAsPt/vXuLBbjxkHqZyQ== -"@cspell/dict-html@^3.0.4": +"@cspell/dict-html@^3.0.5": version "3.0.5" resolved "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-3.0.5.tgz#b7ec878d1ae249a56366666452d5db6199623f89" integrity sha512-Gay6gEKQydJHAoXfEz0sBLoS1x0lgnybJ5X8kO6k149x4I4fOX3IK3TEOox6gFWHI2hD7bY7VkhYLuD8p+HbRw== @@ -1870,54 +1870,54 @@ crypto-random-string@^2.0.0: resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -cspell-gitignore@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-6.7.0.tgz#ef2cf1f0f5522ea90fd8f9ef35dfcd837c2f81e0" - integrity sha512-AaJduSX0tU/onb+CnZkP/vhMmWnaZencVcnmCSDU1aEpxyBZOcC7CrB+JTFRq7Wcy4+UiLkXQwO3u+OZlfNOTg== +cspell-gitignore@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-6.8.0.tgz#6b724d11c524fc0665eb6901c5162bd1d1c2adf7" + integrity sha512-TR1tPWkl7XnowqK4YftTpYWKyzMJQ8veAQaOTC50cgoUCL23FvoUH65yB4rqOuVKNNaIu5CzgzGSEknSC+EyCA== dependencies: - cspell-glob "^6.7.0" + cspell-glob "^6.8.0" find-up "^5.0.0" -cspell-glob@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-6.7.0.tgz#65fc8b5a7aa7daab92c90069287d96af66dca62c" - integrity sha512-6vmZurV4nejOk10KMDJ27s/7WjM7LM7SvTdJOVbJUC50OTXGKva/dv7MqOTpnlAheV45t5R495KBwkUM/Sgsgg== +cspell-glob@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-6.8.0.tgz#4827b8950b5d995535636c8a964eabef2a3eefbb" + integrity sha512-pSVkC+TqfmHYCnBw7gvBctyZtgvugOyvCfYWC+BR37VKcmaI91ZhW7n7SxHlkaKwfLCGi/yMEYBffiJ6FNbeUQ== dependencies: micromatch "^4.0.5" -cspell-grammar@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-6.7.0.tgz#54b7c4025b9628e9987ee8cfd08afae832acc5aa" - integrity sha512-R+ilsGw/H9qA7cTTs17K45P7U1c3kSZfLWEAyJtCwYw4hB+1qPwEZDbOBy4HMywznZ5wp/u9nLQpCEcKFEmqBQ== +cspell-grammar@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-6.8.0.tgz#8d943ace66b2a10e7702a45492798a6a4d051a13" + integrity sha512-FR3zDCtsNASKsVP/bJoQViwf4WiWudXUOHfWJeS1KXAMHY0lp98psWzFzuclXUIU04lh6xkP5zdkEn+BfqtZUA== dependencies: - "@cspell/cspell-pipe" "^6.7.0" - "@cspell/cspell-types" "^6.7.0" + "@cspell/cspell-pipe" "^6.8.0" + "@cspell/cspell-types" "^6.8.0" -cspell-io@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-6.7.0.tgz#f79bf449a2c49a76864f6758c13a35086fe7ea49" - integrity sha512-kJXBk/0PpCYtpY5Q4TjwaUXmGARcqSZrWyW8HnNVNWqnpsTzMr58A7Z0Tm+6/bKKNaTWIc5TzA4QDOel1kjpHQ== +cspell-io@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-6.8.0.tgz#c3b12b02cd8b35d006a926e485696d50befd69d5" + integrity sha512-Jx3Zb1EXtO1AMb011hHyk1AW4Oz/BuOv9xQbH3XH1kTxWzJ21MZzIO1UHDWUhZn7aJI0ybMAZL5+CI4udnd3qg== dependencies: - "@cspell/cspell-service-bus" "^6.7.0" + "@cspell/cspell-service-bus" "^6.8.0" "@types/node-fetch" "^2.6.2" node-fetch "^2.6.7" -cspell-lib@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-6.7.0.tgz#ffe621475c9e166bce9778a831b5dff8c9b088ba" - integrity sha512-Q4AQsBjF7K36xbJjRkFZHR/mljaVMvjupHNPxtJUH6WxvxHwaqIZFKC7D8wZlkLfRNoTvvd6ruU+Ljeo5M4VfQ== +cspell-lib@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-6.8.0.tgz#86551c4dede79c63c8e9411faf615c55fd11c34e" + integrity sha512-BVJUSUvqC9uyQ11f4M5sqGKx307L8sSb+NQtydxWTMqcbn9+NzOTgor3VRcKuzJBH0Q1kN3sccbpzZ225mHP2g== dependencies: - "@cspell/cspell-bundled-dicts" "^6.7.0" - "@cspell/cspell-pipe" "^6.7.0" - "@cspell/cspell-types" "^6.7.0" + "@cspell/cspell-bundled-dicts" "^6.8.0" + "@cspell/cspell-pipe" "^6.8.0" + "@cspell/cspell-types" "^6.8.0" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^5.0.1" cosmiconfig "^7.0.1" - cspell-glob "^6.7.0" - cspell-grammar "^6.7.0" - cspell-io "^6.7.0" - cspell-trie-lib "^6.7.0" + cspell-glob "^6.8.0" + cspell-grammar "^6.8.0" + cspell-io "^6.8.0" + cspell-trie-lib "^6.8.0" fast-equals "^4.0.1" find-up "^5.0.0" fs-extra "^10.1.0" @@ -1928,27 +1928,27 @@ cspell-lib@^6.7.0: vscode-languageserver-textdocument "^1.0.5" vscode-uri "^3.0.3" -cspell-trie-lib@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-6.7.0.tgz#cc0d5ede9589775d05d8e3517423d8e52091ae54" - integrity sha512-RZ5tgK0XBQnR3HQFomHQ31M3JKNHPGazEuCKbiAS6jEYosynErFnW6u1pyx8MjXDlf2Zo8vTRtrz50CAESKZ8g== +cspell-trie-lib@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-6.8.0.tgz#1821f7f7328d1272688146b77ef10eaddce45a99" + integrity sha512-+FKfkXnneuU7n/OrafUQLwOM9TWMFKmtvMZgoJZLX/xOkSHzAlkKqVos8OhK4w2nRns1wy+Nz+iNyEmYaCMnZw== dependencies: - "@cspell/cspell-pipe" "^6.7.0" - "@cspell/cspell-types" "^6.7.0" + "@cspell/cspell-pipe" "^6.8.0" + "@cspell/cspell-types" "^6.8.0" fs-extra "^10.1.0" gensequence "^3.1.1" -cspell@^6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/cspell/-/cspell-6.7.0.tgz#0b0ce2a18d80ae6e6c4c1b7ec381f6093013914e" - integrity sha512-/Ymb8dfwxD+/WnLb1HQ6xlONC8oT1PexdjuE1l4SsHdS0xVMOqvGfVrLUwgvm0pwagpqsGuADTsAdGuYkLS8yA== +cspell@^6.8.0: + version "6.8.0" + resolved "https://registry.npmjs.org/cspell/-/cspell-6.8.0.tgz#de3767f80f6e5fe1c0e9a9826d3b6d799897355d" + integrity sha512-mef1ECEw5bRdxdUvxuf4q7pkUDp9PRaPaLjjcW+v88wp0cyXWhCK/y/MTTa5o+xUkSvHqPXWF1E83NmGey3ZTQ== dependencies: - "@cspell/cspell-pipe" "^6.7.0" + "@cspell/cspell-pipe" "^6.8.0" chalk "^4.1.2" commander "^9.4.0" - cspell-gitignore "^6.7.0" - cspell-glob "^6.7.0" - cspell-lib "^6.7.0" + cspell-gitignore "^6.8.0" + cspell-glob "^6.8.0" + cspell-lib "^6.8.0" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" fs-extra "^10.1.0"