Skip to content

Commit 2e8603d

Browse files
street-side-software-automation[bot]Jason3Sautofix-ci[bot]
authored
feat: Update CSpell version (9.4.0) (#2544)
Co-authored-by: street-side-software-automation[bot] <74785433+street-side-software-automation[bot]@users.noreply.github.com> Co-authored-by: Jason Dent <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 86d1fcf commit 2e8603d

File tree

7 files changed

+1428
-1159
lines changed

7 files changed

+1428
-1159
lines changed

action-src/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
"devDependencies": {
2424
"@actions/core": "^1.11.1",
2525
"@actions/github": "^6.0.1",
26-
"@cspell/cspell-types": "^9.3.2",
26+
"@cspell/cspell-types": "^9.4.0",
2727
"@octokit/webhooks-types": "^7.6.1",
2828
"@types/node": "^24.10.1",
29-
"cspell": "^9.3.2",
30-
"cspell-glob": "^9.3.2",
29+
"cspell": "^9.4.0",
30+
"cspell-glob": "^9.4.0",
3131
"esbuild": "^0.27.0",
3232
"vscode-uri": "^3.1.0"
3333
},
3434
"dependencies": {
35-
"@cspell/cspell-bundled-dicts": "^9.3.2"
35+
"@cspell/cspell-bundled-dicts": "^9.4.0"
3636
},
3737
"files": [
3838
"lib",

action-src/src/reporter.test.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,55 @@ describe('Validate Reporter', () => {
2222
reporter.error?.('This is an error message', new Error('Test error'));
2323
expect(logger.error).toHaveBeenCalledWith(expect.stringContaining('This is an error message'));
2424
});
25+
26+
test.each`
27+
msgType
28+
${'Warning'}
29+
${'Debug'}
30+
${'Info'}
31+
`('Info is ignored $msgType', ({ msgType }) => {
32+
// Currently all "info" messages are ignored.
33+
const logger = createLogger({
34+
debug: vi.fn(),
35+
info: vi.fn(),
36+
warning: vi.fn(),
37+
error: vi.fn(),
38+
});
39+
40+
const actionReporter = new CSpellReporterForGithubAction(
41+
'none',
42+
{ verbose: false, treatFlaggedWordsAsErrors: true },
43+
logger,
44+
);
45+
const reporter = actionReporter.reporter;
46+
47+
reporter.info?.('This is an error message', msgType);
48+
expect(logger.debug).not.toHaveBeenCalled();
49+
expect(logger.error).not.toHaveBeenCalled();
50+
expect(logger.info).not.toHaveBeenCalled();
51+
expect(logger.warning).not.toHaveBeenCalled();
52+
});
53+
54+
test('Debug is ignored', () => {
55+
// Currently all "debug" messages are ignored.
56+
const logger = createLogger({
57+
debug: vi.fn(),
58+
info: vi.fn(),
59+
warning: vi.fn(),
60+
error: vi.fn(),
61+
});
62+
63+
const actionReporter = new CSpellReporterForGithubAction(
64+
'none',
65+
{ verbose: false, treatFlaggedWordsAsErrors: true },
66+
logger,
67+
);
68+
const reporter = actionReporter.reporter;
69+
70+
reporter.debug?.('This is an error message');
71+
expect(logger.debug).not.toHaveBeenCalled();
72+
expect(logger.error).not.toHaveBeenCalled();
73+
expect(logger.info).not.toHaveBeenCalled();
74+
expect(logger.warning).not.toHaveBeenCalled();
75+
});
2576
});

action-src/src/spell.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ describe('Validate Spell Checking', () => {
9191
files: 0,
9292
filesWithIssues: new Set(),
9393
issues: 0,
94+
// skippedFiles: 0,
9495
};
9596

9697
const sampleConfig = resolveFile('fixtures/cspell.json', sourceDir);
@@ -106,12 +107,12 @@ describe('Validate Spell Checking', () => {
106107

107108
test.each`
108109
globs | files | options | expected
109-
${[]} | ${['fixtures/sampleCode/ts/sample.ts']} | ${{}} | ${{ files: 1 }}
110-
${['**/*.ts']} | ${['fixtures/sampleCode/ts/sample.ts']} | ${{}} | ${{ files: 1 }}
110+
${[]} | ${['fixtures/sampleCode/ts/sample.ts']} | ${{}} | ${{ files: 1, skippedFiles: 0 }}
111+
${['**/*.ts']} | ${['fixtures/sampleCode/ts/sample.ts']} | ${{}} | ${{ files: 1, skippedFiles: 0 }}
111112
${[]} | ${['fixtures/sampleCode/ts/missing.ts']} | ${{}} | ${{ files: 0 }}
112113
${[]} | ${[]} | ${{}} | ${{ files: 0 }}
113-
${[]} | ${undefined} | ${sampleCodeTsOptions} | ${{ files: 1 }}
114-
${[]} | ${['fixtures/sampleCode/ts/cspell.config.yaml']} | ${{ config: sampleConfig }} | ${{ files: 1 }}
114+
${[]} | ${undefined} | ${sampleCodeTsOptions} | ${{ files: 1, skippedFiles: 0 }}
115+
${[]} | ${['fixtures/sampleCode/ts/cspell.config.yaml']} | ${{ config: sampleConfig }} | ${{ files: 1, skippedFiles: 0 }}
115116
${[]} | ${['fixtures/sampleCode/ts/cspell.config.yaml']} | ${{ config: sampleConfigTs }} | ${{ files: 0 }}
116117
${['**/*.ts']} | ${['fixtures/sampleCode/ts/cspell.config.yaml']} | ${{ config: sampleConfig }} | ${{ files: 0 }}
117118
${['**/ts/missing.ts']} | ${undefined} | ${{}} | ${{ files: 0 }}
@@ -151,7 +152,7 @@ describe('Validate Spell Checking', () => {
151152
const reporter = new CSpellReporterForGithubAction('warning', { ...rOptions, verbose: false }, logger);
152153
reporter.onIssue = (issue) => issues.push(issue);
153154
await spell.lint(globs, opts, reporter.reporter);
154-
expect(reporter.result).toEqual({ ...defaultResult, ...expected });
155+
expect(reporter.result).toEqual({ ...defaultResult, skippedFiles: 0, ...expected });
155156
expect(issues.map((issue) => issue.text)).toEqual(expectedIssues);
156157
});
157158
});

0 commit comments

Comments
 (0)