Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade go dictionary #2792

Merged
merged 1 commit into from May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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