From 943d86da9710318d858b418c86cd14c17bf9c0e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Feb 2025 15:41:01 -0500 Subject: [PATCH 1/2] feat: add filename and line number to error (#60) --- dist/index.js | 17 ++++++++++------- src/linter.test.ts | 4 ++-- src/linter.ts | 17 ++++++++++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dist/index.js b/dist/index.js index a06c9fd..675a007 100644 --- a/dist/index.js +++ b/dist/index.js @@ -43062,13 +43062,16 @@ ${pendingInterceptorsFormatter.format(pending)} totalErrors += errors.length // Report errors using GitHub annotations for (const error of errors) { - core.error(`${error.ruleId} - ${error.description}`, { - file, - startLine: error.lineNumber, - startColumn: error.column, - endColumn: error.endColumn, - title: 'Axe Linter' - }) + core.error( + `${file}:${error.lineNumber} - ${error.ruleId} - ${error.description}`, + { + file, + startLine: error.lineNumber, + startColumn: error.column, + endColumn: error.endColumn, + title: 'Axe Linter' + } + ) } } core.debug( diff --git a/src/linter.test.ts b/src/linter.test.ts index 9f9fb58..7ae88e3 100644 --- a/src/linter.test.ts +++ b/src/linter.test.ts @@ -113,7 +113,7 @@ describe('linter', () => { // Verify error reporting assert.isTrue( - errorStub.calledWith('test-rule-1 - Test error 1', { + errorStub.calledWith('test.js:1 - test-rule-1 - Test error 1', { file: 'test.js', startLine: 1, startColumn: 1, @@ -124,7 +124,7 @@ describe('linter', () => { ) assert.isTrue( - errorStub.calledWith('test-rule-2 - Test error 2', { + errorStub.calledWith('test.html:1 - test-rule-2 - Test error 2', { file: 'test.html', startLine: 1, startColumn: 1, diff --git a/src/linter.ts b/src/linter.ts index 7b6b180..287b257 100644 --- a/src/linter.ts +++ b/src/linter.ts @@ -55,13 +55,16 @@ export async function lintFiles( // Report errors using GitHub annotations for (const error of errors) { - core.error(`${error.ruleId} - ${error.description}`, { - file, - startLine: error.lineNumber, - startColumn: error.column, - endColumn: error.endColumn, - title: 'Axe Linter' - }) + core.error( + `${file}:${error.lineNumber} - ${error.ruleId} - ${error.description}`, + { + file, + startLine: error.lineNumber, + startColumn: error.column, + endColumn: error.endColumn, + title: 'Axe Linter' + } + ) } } From e7c9735f314ce9f43f2b5ff2ee63a2e4db94f875 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Feb 2025 15:55:21 -0500 Subject: [PATCH 2/2] chore: update `CODEOWNERS` file (#61) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e8b4201..b7fc681 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @dequelabs/axe-api-team +* @dequelabs/ocarina-team