From e6b55e6b6e4123d0d2a2fa40169554ebb583bd6b Mon Sep 17 00:00:00 2001 From: Abigail Glunn Date: Fri, 24 Feb 2023 14:26:36 -0800 Subject: [PATCH 1/2] Add regex to catch errors without file/line information --- main.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index e9b5a32..074562f 100755 --- a/main.js +++ b/main.js @@ -50,6 +50,7 @@ async function main(input, output) { // We only handle the format without --pretty right now const UGLY_REGEX = /^(?.+?)\((?\d+),(?\d+)\): error (?\S+?): (?.+)$/; +const ERROR_WITHOUT_FILE_REGEX = /error (?\S+?): (?.+)$/; /** * @returns {Parser} @@ -58,15 +59,24 @@ function newParser() { const errors = []; function parse(line) { const match = UGLY_REGEX.exec(line); + const errorWithoutFileMatch = ERROR_WITHOUT_FILE_REGEX.exec(line); + if (match) { errors.push({ filename: match.groups.file, line: Number(match.groups.line), col: Number(match.groups.col), code: match.groups.code, - message: match.groups.message - }) - return; + message: match.groups.message, + }); + } else if (errorWithoutFileMatch) { + errors.push({ + code: errorWithoutFileMatch.groups.code, + col: 'N/A', + filename: 'N/A', + line: 'N/A', + message: errorWithoutFileMatch.groups.message, + }); } } return {errors, parse}; From 6e11cdaf9a7a5b99ce9190b4517ed6625502bc56 Mon Sep 17 00:00:00 2001 From: Abigail Glunn Date: Fri, 10 Mar 2023 12:10:01 -0800 Subject: [PATCH 2/2] Add example of error without file info to sample.txt and expected.txt --- expected.txt | 5 ++++- sample.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/expected.txt b/expected.txt index a8f343b..396282b 100644 --- a/expected.txt +++ b/expected.txt @@ -1,9 +1,12 @@ - + + + + diff --git a/sample.txt b/sample.txt index 881f10e..e72d968 100644 --- a/sample.txt +++ b/sample.txt @@ -1,3 +1,4 @@ index.js(34,30): error TS2551: Property 'TracingDataset' does not exist on type 'Options'. Did you mean 'TracingDatase'? index.test.js(52,5): error TS2345: Argument of type '{ APIHost: string; APIKey: string; GlobalMetadata: { global: string; }; DesiredSampleRate: number; TracingDataset: string; }' is not assignable to parameter of type 'Options | "mock"'. Object literal may only specify known properties, but 'TracingDataset' does not exist in type 'Options'. Did you mean to write 'TracingDatase'? +error TS2688: Cannot find type definition file for 'ember__test-helpers'. \ No newline at end of file