Skip to content

Commit

Permalink
feat: Upgrade Java Dictionary (#2992)
Browse files Browse the repository at this point in the history
* feat: Upgrade Java Dictionary
* Add / Update Java integration snapshots
* fix lint warnings
  • Loading branch information
Jason3S committed May 31, 2022
1 parent 4917dff commit e3059aa
Show file tree
Hide file tree
Showing 12 changed files with 1,556 additions and 20 deletions.
9 changes: 9 additions & 0 deletions integration-tests/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@
"--exclude=docs/src/assets/{fonts,s?css,images}"
],
"commit": "68cf0fb7f645da5d992a5e749fc6c1311d30e75a"
},
{
"path": "iluwatar/java-design-patterns",
"url": "https://github.com/iluwatar/java-design-patterns.git",
"args": [
"**/*.md",
"**/*.java"
],
"commit": "4cdc309e65f3a1eae597ecb3b22e5ad6b7abbd41"
}
]
}
5 changes: 5 additions & 0 deletions integration-tests/repositories/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ignorePaths:
- "*.idmap" # DOOM, cspell:ignore idmap
- "*.ogex" # DOOM, cspell:ignore ogex
- "*.spv" # DOOM, binary file
- "*.jar"
- "**/java-design-patterns/**/localization/**" # do not spell check localization files
- "**/eslint/eslint/**/*.svg"
import:
- ./cspell-reporter.json
Expand All @@ -32,6 +34,9 @@ overrides:
- "/\\]\\[.*?\\]/g"
- "/\\]\\(.*?\\)/g"
- "/^\\[.*?\\]:\\s+(#|http|\\.\\.?\\/).*/gm"
- filename: temp/**/java-design-patterns/**/*.md
dictionaries:
- java
dictionaries:
- custom-dictionary
dictionaryDefinitions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Repository: Azure/azure-rest-api-specs
Url: "https://github.com/Azure/azure-rest-api-specs.git"
Args: ["--config=cSpell.json","**/*.{md,ts,js}"]
Lines:
CSpell: Files checked: 1856, Issues found: 2144 in 694 files
CSpell: Files checked: 1856, Issues found: 2145 in 694 files
exit code: 1
./README.md:20:179 - Unknown word (Dataplane) -- RPs' Resource types or Dataplane API versions that represent
./README.md:30:134 - Unknown word (dataplane) -- per resource type or dataplane service version. This
Expand Down Expand Up @@ -365,6 +365,7 @@ Lines:
./specification/saas/resource-manager/readme.go.md:7:39 - Unknown word (armsaas) -- resourcemanager/saas/armsaas
./specification/saas/resource-manager/readme.md:65:47 - Unknown word (exsisting) -- tenant level and its an exsisting API
./specification/scvmm/resource-manager/readme.go.md:8:40 - Unknown word (armscvmm) -- resourcemanager/scvmm/armscvmm
./specification/search/data-plane/Azure.Search/readme.md:292:1 - Unknown word (vararg) -- vararg-properties: >-
./specification/search/data-plane/Azure.Search/readme.md:356:33 - Unknown word (fasterxml) -- replace(/(import com.fasterxml.jackson.annotation.JsonProper
./specification/search/resource-manager/readme.go.md:14:41 - Unknown word (armsearch) -- resourcemanager/search/armsearch
./specification/security/resource-manager/readme.csharp.md:18:40 - Unknown word (securitycenter) -- csharp-sdks-folder)/securitycenter/Microsoft.Azure.Management
Expand Down
763 changes: 763 additions & 0 deletions integration-tests/snapshots/iluwatar/java-design-patterns/report.yaml

Large diffs are not rendered by default.

758 changes: 758 additions & 0 deletions integration-tests/snapshots/iluwatar/java-design-patterns/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
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@cspell/dict-docker": "^1.1.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.5",
"@cspell/dict-en-gb": "^1.1.33",
"@cspell/dict-filetypes": "^2.0.1",
"@cspell/dict-fonts": "^2.0.0",
"@cspell/dict-fullstack": "^2.0.6",
Expand All @@ -66,7 +66,7 @@
"@cspell/dict-haskell": "^2.0.0",
"@cspell/dict-html": "^3.0.1",
"@cspell/dict-html-symbol-entities": "^3.0.0",
"@cspell/dict-java": "^2.0.0",
"@cspell/dict-java": "^3.0.0",
"@cspell/dict-latex": "^2.0.4",
"@cspell/dict-lorem-ipsum": "^2.0.0",
"@cspell/dict-lua": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cspell-glob/src/GlobMatcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Validate Micromatch assumptions', () => {
${'src/*.(test|spec).ts'} | ${'src/deep.code.test.ts'} | ${true}
${'src/*.(test|spec).ts'} | ${'src/test.ts'} | ${false}
`(
`Test Micromatch glob: '$glob', filename: '$filename' expected: $expectedToMatch`,
`Micromatch glob: '$glob', filename: '$filename' expected: $expectedToMatch`,
({ glob, filename, expectedToMatch }) => {
const reg1 = mm.makeRe(glob);
expect(reg1.test(filename)).toEqual(expectedToMatch);
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('Validate Options', () => {
${'i18/nl_NL'} | ${'i18/nl_NL/file.txt'} | ${undefined} | ${{ mode: 'exclude' }} | ${{ matched: true }}
${'i18/nl_NL'} | ${'code/i18/nl_NL/file.txt'} | ${undefined} | ${{ mode: 'exclude' }} | ${{ matched: false }}
${'${cwd}/**/i18/nl_NL'} | ${'code/i18/nl_NL/file.txt'} | ${process.cwd()} | ${{ mode: 'exclude' }} | ${{ matched: true }}
`('Test options: $pattern, $file, $options, root', ({ pattern, file, options, root, expected }: TestCase) => {
`('options: $pattern, $file, $options, root', ({ pattern, file, options, root, expected }: TestCase) => {
root = root || '/Users/code/project/cspell/';
const filename = path.join(root, file);
const patterns = pattern.split('|');
Expand Down
4 changes: 2 additions & 2 deletions packages/cspell-io/src/file/fileReader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Validate the fileReader', () => {
file | contains
${'samples/cities.txt'} | ${'San Francisco'}
${'samples/cities.txt.gz'} | ${'San Francisco'}
`('test reading sync files $file', ({ file, contains }) => {
`('reading sync files $file', ({ file, contains }) => {
const filename = path.resolve(root, file);
const content = fReader.readFileSync(filename);
expect(content).toContain(contains);
Expand All @@ -30,7 +30,7 @@ describe('Validate the fileReader', () => {
file | contains
${'samples/cities.txt'} | ${'San Francisco'}
${'samples/cities.txt.gz'} | ${'San Francisco'}
`('test reading async files $file', async ({ file, contains }) => {
`('reading async files $file', async ({ file, contains }) => {
const filename = path.resolve(root, file);
const content = await fReader.readFile(filename);
expect(content).toContain(contains);
Expand Down
2 changes: 1 addition & 1 deletion packages/cspell-lib/src/exclusionHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Verify Exclusion Helper functions', () => {
${'file:///project/myProject/node_modules/test/test.js'} | ${true}
${'file:///project/myProject/.vscode/cSpell.json'} | ${true}
${'file:///project/myProject/.github/node_modules/cSpell.json'} | ${true}
`('test generated matching function "$uri" expected: $expected', ({ uri, expected }) => {
`('generated matching function "$uri" expected: $expected', ({ uri, expected }) => {
expect(fnExcludeGlobs(uri)).toBe(expected);
});

Expand Down
6 changes: 3 additions & 3 deletions packages/cspell-tools/src/compiler/wordListCompiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Validate the wordListCompiler', () => {
${'CURLcode'} | ${['cur', 'lcode']}
${'kDNSServiceErr_BadSig'} | ${['k', 'dns', 'service', 'err', 'bad', 'sig']}
${'apd_get_active_symbols'} | ${['apd', 'get', 'active', 'symbols']}
`('test legacy splitting lines $line', ({ line, expectedResult }: { line: string; expectedResult: string[] }) => {
`('legacy splitting lines $line', ({ line, expectedResult }: { line: string; expectedResult: string[] }) => {
expect(legacyLineToWords(line).filter(distinct()).toArray()).toEqual(expectedResult);
});

Expand All @@ -70,7 +70,7 @@ describe('Validate the wordListCompiler', () => {
${'kDNSServiceErr_BadSig'} | ${['k', 'dns', 'service', 'err', 'bad', 'sig']}
${'apd_get_active_symbols'} | ${['apd', 'get', 'active', 'symbols']}
`(
'test normalizer uses legacy line splitting $lines',
'normalizer uses legacy line splitting $lines',
({ lines, expectedResult }: { lines: string; expectedResult: string[] }) => {
const normalizer = __testing__.createNormalizer({
skipNormalization: false,
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('Validate the wordListCompiler', () => {
${'CURLcode'} | ${['CURLcode']} | ${true} | ${true}
${'kDNSServiceErr_BadSig'} | ${['kDNSServiceErr_BadSig']} | ${true} | ${true}
${'apd_get_active_symbols'} | ${['apd_get_active_symbols']} | ${true} | ${true}
`('test normalizer line splitting "$text" $splitWords $keepRawCase', (testCase: NormalizeTestCase) => {
`('normalizer line splitting "$text" $splitWords $keepRawCase', (testCase: NormalizeTestCase) => {
const {
skipNormalization = false,
splitWords = false,
Expand Down
4 changes: 2 additions & 2 deletions packages/cspell-trie-lib/src/lib/suggestions/suggest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('Validate Suggest', () => {
${'walkingstick'} | ${undefined} | ${2} | ${undefined} | ${[sr('walkingstick', 0), sr('talkingstick', 99)]}
${'walkingtree'} | ${undefined} | ${2} | ${undefined} | ${[sr('talkingtree', 99), sr('walkingstick', 359)]}
${'running'} | ${undefined} | ${2} | ${undefined} | ${[sr('running', 0), sr('Running', 1)]}
`('test suggestion results $word', ({ word, ignoreCase, numSuggestions, changeLimit, expected }) => {
`('suggestion results $word', ({ word, ignoreCase, numSuggestions, changeLimit, expected }) => {
const trie = parseDictionary(`
walk
Running*
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('Validate Suggest', () => {
${'running'} | ${undefined} | ${2} | ${3} | ${[sr('running', 0), sr('Running', 1)]}
${'free'} | ${undefined} | ${2} | ${2} | ${[sr('tree', 99)]}
${'stock'} | ${undefined} | ${2} | ${2} | ${[sr('stick', 97)]}
`('test suggestWithCost results $word', ({ word, ignoreCase, numSuggestions, changeLimit, expected }) => {
`('suggestWithCost results $word', ({ word, ignoreCase, numSuggestions, changeLimit, expected }) => {
const trie = parseDictionary(`
walk
Running*
Expand Down

0 comments on commit e3059aa

Please sign in to comment.