Skip to content

Commit 0427c3b

Browse files
lapfelixclaude
andcommitted
Fix duplicate warnings and errors in build output
Previously, XCLogParser would output many duplicate warnings/errors when parsing build logs. This was particularly noticeable with warnings like deprecated API usage that appeared dozens of times. Changes: - Modified BuildLogParser to deduplicate error and warning strings using Set - Applied deduplication after formatting but before returning results - Preserves all unique warnings while eliminating exact duplicates Example: A build with 91 total warnings but only 7 unique ones now correctly displays just the 7 unique warnings. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 69e2c5b commit 0427c3b

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

dist/cli.js

100644100755
File mode changed.

dist/index.js

100644100755
File mode changed.

dist/utils/BuildLogParser.js

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/utils/BuildLogParser.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/BuildLogParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export class BuildLogParser {
302302
try {
303303
const result: XCLogParserResult = JSON.parse(stdout);
304304

305-
const errors = (result.errors || []).map(error => {
305+
const errors = [...new Set((result.errors || []).map(error => {
306306
const fileName = error.documentURL ? error.documentURL.replace('file://', '') : 'Unknown file';
307307
const line = error.startingLineNumber;
308308
const column = error.startingColumnNumber;
@@ -316,9 +316,9 @@ export class BuildLogParser {
316316
}
317317

318318
return `${location}: ${error.title}`;
319-
});
319+
}))];
320320

321-
const warnings = (result.warnings || []).map(warning => {
321+
const warnings = [...new Set((result.warnings || []).map(warning => {
322322
const fileName = warning.documentURL ? warning.documentURL.replace('file://', '') : 'Unknown file';
323323
const line = warning.startingLineNumber;
324324
const column = warning.startingColumnNumber;
@@ -332,7 +332,7 @@ export class BuildLogParser {
332332
}
333333

334334
return `${location}: ${warning.title}`;
335-
});
335+
}))];
336336

337337
const buildResult: ParsedBuildResults = {
338338
errors,

0 commit comments

Comments
 (0)