Skip to content

Commit

Permalink
feat: Upgrade go dictionary (#2792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed May 4, 2022
1 parent ac0f9e9 commit 778b8fe
Show file tree
Hide file tree
Showing 7 changed files with 452 additions and 99 deletions.
302 changes: 233 additions & 69 deletions integration-tests/snapshots/caddyserver/caddy/report.yaml

Large diffs are not rendered by default.

196 changes: 180 additions & 16 deletions integration-tests/snapshots/caddyserver/caddy/snapshot.txt

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions packages/cspell-bundled-dicts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cspell-bundled-dicts/package.json
Expand Up @@ -55,13 +55,13 @@
"@cspell/dict-django": "^2.0.0",
"@cspell/dict-dotnet": "^2.0.1",
"@cspell/dict-elixir": "^2.0.1",
"@cspell/dict-en-gb": "^1.1.33",
"@cspell/dict-en_us": "^2.2.2",
"@cspell/dict-en-gb": "^1.1.33",
"@cspell/dict-filetypes": "^2.0.1",
"@cspell/dict-fonts": "^2.0.0",
"@cspell/dict-fullstack": "^2.0.5",
"@cspell/dict-git": "^1.0.1",
"@cspell/dict-golang": "^2.0.0",
"@cspell/dict-golang": "^3.0.1",
"@cspell/dict-haskell": "^2.0.0",
"@cspell/dict-html": "^3.0.1",
"@cspell/dict-html-symbol-entities": "^3.0.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/cspell-lib/src/test/__snapshots__/bugs.spec.ts.snap
Expand Up @@ -2,6 +2,28 @@

exports[`Validate Against Bug Fixes validate ../src/sample.go 1`] = `
Array [
Object {
"isFlagged": false,
"isFound": false,
"line": Object {
"offset": 265,
"text": " longname(i)
",
},
"offset": 266,
"text": "longname",
},
Object {
"isFlagged": false,
"isFound": false,
"line": Object {
"offset": 344,
"text": "func longname(i I) {
",
},
"offset": 349,
"text": "longname",
},
Object {
"isFlagged": false,
"isFound": false,
Expand Down
6 changes: 3 additions & 3 deletions packages/cspell-lib/src/test/golang.spec.ts
Expand Up @@ -14,12 +14,12 @@ describe('Validate that Go files are correctly checked.', () => {
const languageIds = cspell.getLanguagesForExt(ext);
const settings = cspell.getDefaultBundledSettings();
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
// cspell:ignore weirdd garbbage
// cspell:ignore weirdd garbbage longname
const results1 = await cspell.validateText('some weirdd garbbage', fileSettings);
expect(results1.map((t) => t.text)).toEqual(expect.arrayContaining(['weirdd']));
expect(results1.map((t) => t.text)).toEqual(expect.arrayContaining(['garbbage']));
const results = await cspell.validateText(text, fileSettings);
expect(results).toHaveLength(1);
expect(results.map((t) => t.text)).toEqual(expect.arrayContaining(['garbbage']));
expect(results).toHaveLength(3);
expect(results.map((t) => t.text)).toEqual(expect.arrayContaining(['longname', 'garbbage']));
});
});
7 changes: 5 additions & 2 deletions packages/cspell/src/application.test.ts
Expand Up @@ -20,6 +20,7 @@ const featuresRoot = r(fixturesRoot, 'features');
const sampleOptions = { root: samplesRoot };

const oc = expect.objectContaining;
const ac = expect.arrayContaining;

jest.mock('get-stdin', () => {
return jest.fn(() => Promise.resolve(getStdinResult.value));
Expand Down Expand Up @@ -251,10 +252,12 @@ function sampleTests(): SampleTest[] {
file: 'samples/src/sample.go',
options: { showSuggestions: true, showContext: true },
issues: [
{ text: 'longname' },
{ text: 'longname' },
{
text: 'garbbage',
suggestions: expect.arrayContaining(['garbage', 'garage']),
context: expect.objectContaining({ text: 'Deliberate misspelling: garbbage. */' }),
suggestions: ac(['garbage', 'garage']),
context: oc({ text: 'Deliberate misspelling: garbbage. */' }),
},
],
},
Expand Down

0 comments on commit 778b8fe

Please sign in to comment.