@vibe-validate/extractors 0.16.1 → 0.17.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extractor-registry.d.ts +104 -0
- package/dist/extractor-registry.d.ts.map +1 -0
- package/dist/extractor-registry.js +278 -0
- package/dist/extractor-registry.js.map +1 -0
- package/dist/extractors/ava/index.d.ts +23 -0
- package/dist/extractors/ava/index.d.ts.map +1 -0
- package/dist/extractors/ava/index.js +507 -0
- package/dist/extractors/ava/index.js.map +1 -0
- package/dist/extractors/ava/index.test.d.ts +7 -0
- package/dist/extractors/ava/index.test.d.ts.map +1 -0
- package/dist/extractors/ava/index.test.js +408 -0
- package/dist/extractors/ava/index.test.js.map +1 -0
- package/dist/extractors/eslint/index.d.ts +18 -0
- package/dist/extractors/eslint/index.d.ts.map +1 -0
- package/dist/extractors/eslint/index.js +206 -0
- package/dist/extractors/eslint/index.js.map +1 -0
- package/dist/extractors/eslint/index.test.d.ts +9 -0
- package/dist/extractors/eslint/index.test.d.ts.map +1 -0
- package/dist/extractors/eslint/index.test.js +191 -0
- package/dist/extractors/eslint/index.test.js.map +1 -0
- package/dist/extractors/generic/index.d.ts +30 -0
- package/dist/extractors/generic/index.d.ts.map +1 -0
- package/dist/extractors/generic/index.js +140 -0
- package/dist/extractors/generic/index.js.map +1 -0
- package/dist/extractors/generic/index.test.d.ts +7 -0
- package/dist/extractors/generic/index.test.d.ts.map +1 -0
- package/dist/extractors/generic/index.test.js +61 -0
- package/dist/extractors/generic/index.test.js.map +1 -0
- package/dist/extractors/jasmine/index.d.ts +17 -0
- package/dist/extractors/jasmine/index.d.ts.map +1 -0
- package/dist/extractors/jasmine/index.js +242 -0
- package/dist/extractors/jasmine/index.js.map +1 -0
- package/dist/extractors/jasmine/index.test.d.ts +7 -0
- package/dist/extractors/jasmine/index.test.d.ts.map +1 -0
- package/dist/extractors/jasmine/index.test.js +318 -0
- package/dist/extractors/jasmine/index.test.js.map +1 -0
- package/dist/extractors/jest/index.d.ts +17 -0
- package/dist/extractors/jest/index.d.ts.map +1 -0
- package/dist/extractors/jest/index.js +273 -0
- package/dist/extractors/jest/index.js.map +1 -0
- package/dist/extractors/jest/index.test.d.ts +9 -0
- package/dist/extractors/jest/index.test.d.ts.map +1 -0
- package/dist/extractors/jest/index.test.js +338 -0
- package/dist/extractors/jest/index.test.js.map +1 -0
- package/dist/extractors/junit/index.d.ts +18 -0
- package/dist/extractors/junit/index.d.ts.map +1 -0
- package/dist/extractors/junit/index.js +259 -0
- package/dist/extractors/junit/index.js.map +1 -0
- package/dist/extractors/junit/index.test.d.ts +7 -0
- package/dist/extractors/junit/index.test.d.ts.map +1 -0
- package/dist/extractors/junit/index.test.js +341 -0
- package/dist/extractors/junit/index.test.js.map +1 -0
- package/dist/extractors/maven-checkstyle/index.d.ts +23 -0
- package/dist/extractors/maven-checkstyle/index.d.ts.map +1 -0
- package/dist/extractors/maven-checkstyle/index.js +263 -0
- package/dist/extractors/maven-checkstyle/index.js.map +1 -0
- package/dist/extractors/maven-checkstyle/index.test.d.ts +2 -0
- package/dist/extractors/maven-checkstyle/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-checkstyle/index.test.js +197 -0
- package/dist/extractors/maven-checkstyle/index.test.js.map +1 -0
- package/dist/extractors/maven-compiler/index.d.ts +23 -0
- package/dist/extractors/maven-compiler/index.d.ts.map +1 -0
- package/dist/extractors/maven-compiler/index.js +271 -0
- package/dist/extractors/maven-compiler/index.js.map +1 -0
- package/dist/extractors/maven-compiler/index.test.d.ts +2 -0
- package/dist/extractors/maven-compiler/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-compiler/index.test.js +189 -0
- package/dist/extractors/maven-compiler/index.test.js.map +1 -0
- package/dist/extractors/maven-surefire/index.d.ts +23 -0
- package/dist/extractors/maven-surefire/index.d.ts.map +1 -0
- package/dist/extractors/maven-surefire/index.js +292 -0
- package/dist/extractors/maven-surefire/index.js.map +1 -0
- package/dist/extractors/maven-surefire/index.test.d.ts +2 -0
- package/dist/extractors/maven-surefire/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-surefire/index.test.js +163 -0
- package/dist/extractors/maven-surefire/index.test.js.map +1 -0
- package/dist/extractors/mocha/index.d.ts +17 -0
- package/dist/extractors/mocha/index.d.ts.map +1 -0
- package/dist/extractors/mocha/index.js +241 -0
- package/dist/extractors/mocha/index.js.map +1 -0
- package/dist/extractors/mocha/index.test.d.ts +7 -0
- package/dist/extractors/mocha/index.test.d.ts.map +1 -0
- package/dist/extractors/mocha/index.test.js +300 -0
- package/dist/extractors/mocha/index.test.js.map +1 -0
- package/dist/extractors/playwright/index.d.ts +17 -0
- package/dist/extractors/playwright/index.d.ts.map +1 -0
- package/dist/extractors/playwright/index.js +320 -0
- package/dist/extractors/playwright/index.js.map +1 -0
- package/dist/extractors/playwright/index.test.d.ts +7 -0
- package/dist/extractors/playwright/index.test.d.ts.map +1 -0
- package/dist/extractors/playwright/index.test.js +274 -0
- package/dist/extractors/playwright/index.test.js.map +1 -0
- package/dist/extractors/tap/index.d.ts +23 -0
- package/dist/extractors/tap/index.d.ts.map +1 -0
- package/dist/extractors/tap/index.js +352 -0
- package/dist/extractors/tap/index.js.map +1 -0
- package/dist/extractors/tap/index.test.d.ts +7 -0
- package/dist/extractors/tap/index.test.d.ts.map +1 -0
- package/dist/extractors/tap/index.test.js +100 -0
- package/dist/extractors/tap/index.test.js.map +1 -0
- package/dist/extractors/typescript/index.d.ts +17 -0
- package/dist/extractors/typescript/index.d.ts.map +1 -0
- package/dist/extractors/typescript/index.js +150 -0
- package/dist/extractors/typescript/index.js.map +1 -0
- package/dist/extractors/typescript/index.test.d.ts +9 -0
- package/dist/extractors/typescript/index.test.d.ts.map +1 -0
- package/dist/extractors/typescript/index.test.js +177 -0
- package/dist/extractors/typescript/index.test.js.map +1 -0
- package/dist/extractors/vitest/index.d.ts +17 -0
- package/dist/extractors/vitest/index.d.ts.map +1 -0
- package/dist/extractors/vitest/index.js +564 -0
- package/dist/extractors/vitest/index.js.map +1 -0
- package/dist/extractors/vitest/index.test.d.ts +9 -0
- package/dist/extractors/vitest/index.test.d.ts.map +1 -0
- package/dist/extractors/vitest/index.test.js +373 -0
- package/dist/extractors/vitest/index.test.js.map +1 -0
- package/dist/index.d.ts +27 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/dist/maven-checkstyle-extractor.d.ts +20 -0
- package/dist/maven-checkstyle-extractor.d.ts.map +1 -0
- package/dist/maven-checkstyle-extractor.js +193 -0
- package/dist/maven-checkstyle-extractor.js.map +1 -0
- package/dist/maven-compiler-extractor.d.ts +20 -0
- package/dist/maven-compiler-extractor.d.ts.map +1 -0
- package/dist/maven-compiler-extractor.js +218 -0
- package/dist/maven-compiler-extractor.js.map +1 -0
- package/dist/maven-surefire-extractor.d.ts +20 -0
- package/dist/maven-surefire-extractor.d.ts.map +1 -0
- package/dist/maven-surefire-extractor.js +228 -0
- package/dist/maven-surefire-extractor.js.map +1 -0
- package/dist/maven-utils.d.ts +24 -0
- package/dist/maven-utils.d.ts.map +1 -0
- package/dist/maven-utils.js +36 -0
- package/dist/maven-utils.js.map +1 -0
- package/dist/plugin-loader.d.ts +82 -0
- package/dist/plugin-loader.d.ts.map +1 -0
- package/dist/plugin-loader.js +200 -0
- package/dist/plugin-loader.js.map +1 -0
- package/dist/sandbox.d.ts +161 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +254 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/sandbox.test.d.ts +8 -0
- package/dist/sandbox.test.d.ts.map +1 -0
- package/dist/sandbox.test.js +395 -0
- package/dist/sandbox.test.js.map +1 -0
- package/dist/sandboxed-extractor.d.ts +46 -0
- package/dist/sandboxed-extractor.d.ts.map +1 -0
- package/dist/sandboxed-extractor.js +172 -0
- package/dist/sandboxed-extractor.js.map +1 -0
- package/dist/sandboxed-extractor.test.d.ts +5 -0
- package/dist/sandboxed-extractor.test.d.ts.map +1 -0
- package/dist/sandboxed-extractor.test.js +346 -0
- package/dist/sandboxed-extractor.test.js.map +1 -0
- package/dist/smart-extractor.d.ts +22 -10
- package/dist/smart-extractor.d.ts.map +1 -1
- package/dist/smart-extractor.js +116 -163
- package/dist/smart-extractor.js.map +1 -1
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maven Checkstyle error extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts errors from Maven Checkstyle plugin output.
|
|
5
|
+
* Supports both output formats generated by maven-checkstyle-plugin.
|
|
6
|
+
*/
|
|
7
|
+
import { MAX_ERRORS_IN_ARRAY } from './result-schema.js';
|
|
8
|
+
import { extractRelativePath } from './maven-utils.js';
|
|
9
|
+
const CHECKSTYLE_PATTERNS = {
|
|
10
|
+
// Format 1: [WARN] /absolute/path:line:col: message [Rule]
|
|
11
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: Maven Checkstyle output is structured, limited line length
|
|
12
|
+
warnFormat: /^\[WARN\]\s+([^:]+):(\d+):(\d+):\s+(.+?)\s+\[(\w+)\]$/,
|
|
13
|
+
// Format 2: [WARNING] relative/path:[line,col] (category) Rule: message
|
|
14
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: Maven Checkstyle output is structured, limited line length
|
|
15
|
+
warningFormat: /^\[WARNING\]\s+([^:]+):\[(\d+)(?:,(\d+))?\]\s+\((\w+)\)\s+(\w+):\s+(.+)$/,
|
|
16
|
+
// Summary line: "You have N Checkstyle violations"
|
|
17
|
+
summary: /You have (\d+) Checkstyle violations/,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Detects if output is from Maven Checkstyle
|
|
21
|
+
*/
|
|
22
|
+
export function detectMavenCheckstyle(output) {
|
|
23
|
+
const lines = output.split('\n');
|
|
24
|
+
let score = 0;
|
|
25
|
+
const foundPatterns = [];
|
|
26
|
+
// Look for Checkstyle-specific markers
|
|
27
|
+
let hasViolationFormat = false;
|
|
28
|
+
for (const line of lines) {
|
|
29
|
+
if (line.includes('maven-checkstyle-plugin')) {
|
|
30
|
+
score += 40;
|
|
31
|
+
foundPatterns.push('maven-checkstyle-plugin reference');
|
|
32
|
+
}
|
|
33
|
+
if (line.includes('Starting audit')) {
|
|
34
|
+
score += 20;
|
|
35
|
+
foundPatterns.push('Checkstyle audit start marker');
|
|
36
|
+
}
|
|
37
|
+
if (line.includes('Audit done')) {
|
|
38
|
+
score += 20;
|
|
39
|
+
foundPatterns.push('Checkstyle audit complete marker');
|
|
40
|
+
}
|
|
41
|
+
if (CHECKSTYLE_PATTERNS.summary.test(line)) {
|
|
42
|
+
score += 30;
|
|
43
|
+
foundPatterns.push('Checkstyle violation summary');
|
|
44
|
+
}
|
|
45
|
+
if (!hasViolationFormat && (CHECKSTYLE_PATTERNS.warnFormat.test(line) || CHECKSTYLE_PATTERNS.warningFormat.test(line))) {
|
|
46
|
+
score += 10;
|
|
47
|
+
foundPatterns.push('Checkstyle violation format');
|
|
48
|
+
hasViolationFormat = true; // Only count once, but don't break - keep looking for other markers
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Determine reason based on score
|
|
52
|
+
let reason;
|
|
53
|
+
if (score >= 70) {
|
|
54
|
+
reason = 'Maven Checkstyle plugin output detected';
|
|
55
|
+
}
|
|
56
|
+
else if (score >= 40) {
|
|
57
|
+
reason = 'Possible Maven Checkstyle output';
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
reason = 'Not Maven Checkstyle output';
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
confidence: Math.min(score, 100),
|
|
64
|
+
patterns: foundPatterns,
|
|
65
|
+
reason,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Extracts Checkstyle violations from Maven output
|
|
70
|
+
*/
|
|
71
|
+
export function extractMavenCheckstyle(output, command) {
|
|
72
|
+
const detection = detectMavenCheckstyle(output);
|
|
73
|
+
if (detection.confidence < 40) {
|
|
74
|
+
return {
|
|
75
|
+
summary: 'Not Maven Checkstyle output',
|
|
76
|
+
totalErrors: 0,
|
|
77
|
+
errors: [],
|
|
78
|
+
metadata: {
|
|
79
|
+
detection: {
|
|
80
|
+
extractor: 'maven-checkstyle',
|
|
81
|
+
confidence: detection.confidence,
|
|
82
|
+
patterns: detection.patterns,
|
|
83
|
+
reason: detection.reason,
|
|
84
|
+
},
|
|
85
|
+
confidence: detection.confidence,
|
|
86
|
+
completeness: 100,
|
|
87
|
+
issues: [],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const violations = [];
|
|
92
|
+
const lines = output.split('\n');
|
|
93
|
+
for (const line of lines) {
|
|
94
|
+
// Try Format 1: [WARN] /path:line:col: message [Rule]
|
|
95
|
+
const warnMatch = CHECKSTYLE_PATTERNS.warnFormat.exec(line);
|
|
96
|
+
if (warnMatch) {
|
|
97
|
+
const [, filePath, lineStr, colStr, message, rule] = warnMatch;
|
|
98
|
+
violations.push({
|
|
99
|
+
file: extractRelativePath(filePath),
|
|
100
|
+
line: Number.parseInt(lineStr, 10),
|
|
101
|
+
column: Number.parseInt(colStr, 10),
|
|
102
|
+
message: message.trim(),
|
|
103
|
+
rule: rule.trim(),
|
|
104
|
+
});
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// Try Format 2: [WARNING] path:[line,col] (category) Rule: message
|
|
108
|
+
const warningMatch = CHECKSTYLE_PATTERNS.warningFormat.exec(line);
|
|
109
|
+
if (warningMatch) {
|
|
110
|
+
const [, filePath, lineStr, colStr, category, rule, message] = warningMatch;
|
|
111
|
+
violations.push({
|
|
112
|
+
file: filePath.trim(),
|
|
113
|
+
line: Number.parseInt(lineStr, 10),
|
|
114
|
+
column: colStr ? Number.parseInt(colStr, 10) : undefined,
|
|
115
|
+
message: message.trim(),
|
|
116
|
+
rule: rule.trim(),
|
|
117
|
+
category: category.trim(),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Remove duplicates (both formats report same violations)
|
|
122
|
+
const uniqueViolations = deduplicateViolations(violations);
|
|
123
|
+
// Convert to FormattedError format
|
|
124
|
+
const errors = uniqueViolations.slice(0, MAX_ERRORS_IN_ARRAY).map((v) => ({
|
|
125
|
+
file: v.file,
|
|
126
|
+
line: v.line,
|
|
127
|
+
column: v.column,
|
|
128
|
+
message: `${v.message} [${v.rule}]`,
|
|
129
|
+
}));
|
|
130
|
+
// Group by file for summary
|
|
131
|
+
const fileGroups = groupByFile(uniqueViolations);
|
|
132
|
+
const summary = `${uniqueViolations.length} Checkstyle violation(s) in ${fileGroups.size} file(s)`;
|
|
133
|
+
// Generate guidance
|
|
134
|
+
const guidance = uniqueViolations.length > 0
|
|
135
|
+
? `Fix Checkstyle violations. Run ${command ?? 'mvn checkstyle:check'} to see all details.`
|
|
136
|
+
: undefined;
|
|
137
|
+
// Create error summary
|
|
138
|
+
const errorSummary = errors.length > 0
|
|
139
|
+
? errors.map((e, i) => `[Error ${i + 1}/${errors.length}] ${e.file}:${e.line}\n${e.message}`).join('\n\n')
|
|
140
|
+
: undefined;
|
|
141
|
+
return {
|
|
142
|
+
summary,
|
|
143
|
+
totalErrors: uniqueViolations.length,
|
|
144
|
+
errors,
|
|
145
|
+
guidance,
|
|
146
|
+
errorSummary,
|
|
147
|
+
metadata: {
|
|
148
|
+
detection: {
|
|
149
|
+
extractor: 'maven-checkstyle',
|
|
150
|
+
confidence: detection.confidence,
|
|
151
|
+
patterns: detection.patterns,
|
|
152
|
+
reason: detection.reason,
|
|
153
|
+
},
|
|
154
|
+
confidence: 100,
|
|
155
|
+
completeness: 100,
|
|
156
|
+
issues: [],
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
// Relative path extraction moved to maven-utils.ts (shared with maven-compiler-extractor)
|
|
161
|
+
/**
|
|
162
|
+
* Deduplicate violations (both formats report same violations)
|
|
163
|
+
*/
|
|
164
|
+
function deduplicateViolations(violations) {
|
|
165
|
+
const seen = new Set();
|
|
166
|
+
const unique = [];
|
|
167
|
+
for (const v of violations) {
|
|
168
|
+
const key = `${v.file}:${v.line}:${v.column}:${v.rule}`;
|
|
169
|
+
if (!seen.has(key)) {
|
|
170
|
+
seen.add(key);
|
|
171
|
+
unique.push(v);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return unique;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Group violations by file
|
|
178
|
+
*/
|
|
179
|
+
function groupByFile(violations) {
|
|
180
|
+
const groups = new Map();
|
|
181
|
+
for (const violation of violations) {
|
|
182
|
+
const file = violation.file || 'unknown';
|
|
183
|
+
if (!groups.has(file)) {
|
|
184
|
+
groups.set(file, []);
|
|
185
|
+
}
|
|
186
|
+
const group = groups.get(file);
|
|
187
|
+
if (group) {
|
|
188
|
+
group.push(violation);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return groups;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=maven-checkstyle-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maven-checkstyle-extractor.js","sourceRoot":"","sources":["../src/maven-checkstyle-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAqBvD,MAAM,mBAAmB,GAAG;IAC1B,2DAA2D;IAC3D,kHAAkH;IAClH,UAAU,EAAE,uDAAuD;IAEnE,wEAAwE;IACxE,kHAAkH;IAClH,aAAa,EAAE,0EAA0E;IAEzF,mDAAmD;IACnD,OAAO,EAAE,sCAAsC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAKlD,MAAM,KAAK,GAA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
|
|
3
|
+
*
|
|
4
|
+
* Extracts Java compilation errors from Maven compiler plugin output.
|
|
5
|
+
* Supports output from `mvn compile` and `mvn test` when compilation fails.
|
|
6
|
+
*/
|
|
7
|
+
import type { ErrorExtractorResult } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Detects if output is from Maven compiler plugin
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectMavenCompiler(output: string): {
|
|
12
|
+
confidence: number;
|
|
13
|
+
patterns: string[];
|
|
14
|
+
reason: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Extracts compilation errors from Maven compiler output
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractMavenCompiler(output: string, command?: string): ErrorExtractorResult;
|
|
20
|
+
//# sourceMappingURL=maven-compiler-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maven-compiler-extractor.d.ts","sourceRoot":"","sources":["../src/maven-compiler-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,YAAY,CAAC;AA6CvE;;GAEG;AAEH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CA2DA;AAED;;GAEG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,oBAAoB,CAyGtB"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maven Compiler error extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts Java compilation errors from Maven compiler plugin output.
|
|
5
|
+
* Supports output from `mvn compile` and `mvn test` when compilation fails.
|
|
6
|
+
*/
|
|
7
|
+
import { MAX_ERRORS_IN_ARRAY } from './result-schema.js';
|
|
8
|
+
import { extractRelativePath } from './maven-utils.js';
|
|
9
|
+
const COMPILER_PATTERNS = {
|
|
10
|
+
// [ERROR] /path/to/File.java:[line,column] error message
|
|
11
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: Maven compiler output is structured, limited line length
|
|
12
|
+
errorLine: /^\[ERROR\]\s+([^:]+):\[(\d+)(?:,(\d+))?\]\s+(.+)$/,
|
|
13
|
+
// Markers for high-confidence detection
|
|
14
|
+
compilationErrorMarker: /^\[ERROR\]\s+COMPILATION ERROR\s*:/,
|
|
15
|
+
compilerPluginMarker: /maven-compiler-plugin/,
|
|
16
|
+
errorCountMarker: /^\[INFO\]\s+(\d+)\s+errors?\s*$/,
|
|
17
|
+
// Common Java compiler error patterns
|
|
18
|
+
compilerErrorPatterns: [
|
|
19
|
+
'cannot find symbol',
|
|
20
|
+
'incompatible types',
|
|
21
|
+
'class, interface, or enum expected',
|
|
22
|
+
'illegal start of expression',
|
|
23
|
+
'reached end of file while parsing',
|
|
24
|
+
'package .* does not exist',
|
|
25
|
+
'method .* cannot be applied',
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Detects if output is from Maven compiler plugin
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 22 acceptable for detection (sequentially checks 5 distinct Maven compiler output patterns for accurate detection)
|
|
32
|
+
export function detectMavenCompiler(output) {
|
|
33
|
+
const lines = output.split('\n');
|
|
34
|
+
let score = 0;
|
|
35
|
+
const foundPatterns = [];
|
|
36
|
+
// Look for compilation error markers
|
|
37
|
+
let hasErrorLineFormat = false;
|
|
38
|
+
let hasCompilerErrorPattern = false;
|
|
39
|
+
for (const line of lines) {
|
|
40
|
+
// High-value markers (30 points each)
|
|
41
|
+
if (COMPILER_PATTERNS.compilationErrorMarker.test(line)) {
|
|
42
|
+
score += 30;
|
|
43
|
+
foundPatterns.push('[ERROR] COMPILATION ERROR marker');
|
|
44
|
+
}
|
|
45
|
+
if (COMPILER_PATTERNS.compilerPluginMarker.test(line)) {
|
|
46
|
+
score += 30;
|
|
47
|
+
foundPatterns.push('maven-compiler-plugin reference');
|
|
48
|
+
}
|
|
49
|
+
// Medium-value markers (20 points)
|
|
50
|
+
if (COMPILER_PATTERNS.errorCountMarker.test(line)) {
|
|
51
|
+
score += 20;
|
|
52
|
+
foundPatterns.push('error count summary');
|
|
53
|
+
}
|
|
54
|
+
if (!hasErrorLineFormat && COMPILER_PATTERNS.errorLine.test(line)) {
|
|
55
|
+
score += 20;
|
|
56
|
+
foundPatterns.push('file:[line,column] format');
|
|
57
|
+
hasErrorLineFormat = true;
|
|
58
|
+
}
|
|
59
|
+
// Low-value markers (10 points for first match)
|
|
60
|
+
if (!hasCompilerErrorPattern) {
|
|
61
|
+
for (const pattern of COMPILER_PATTERNS.compilerErrorPatterns) {
|
|
62
|
+
if (line.includes(pattern)) {
|
|
63
|
+
score += 10;
|
|
64
|
+
foundPatterns.push('Java compiler error pattern');
|
|
65
|
+
hasCompilerErrorPattern = true;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Determine reason based on score
|
|
72
|
+
let reason;
|
|
73
|
+
if (score >= 70) {
|
|
74
|
+
reason = 'Maven compiler plugin output detected';
|
|
75
|
+
}
|
|
76
|
+
else if (score >= 40) {
|
|
77
|
+
reason = 'Possible Maven compiler output';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
reason = 'Not Maven compiler output';
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
confidence: Math.min(score, 100),
|
|
84
|
+
patterns: foundPatterns,
|
|
85
|
+
reason,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Extracts compilation errors from Maven compiler output
|
|
90
|
+
*/
|
|
91
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 21 acceptable for extraction (parses Maven compiler output with context lines, deduplication, and error formatting)
|
|
92
|
+
export function extractMavenCompiler(output, command) {
|
|
93
|
+
const detection = detectMavenCompiler(output);
|
|
94
|
+
if (detection.confidence < 40) {
|
|
95
|
+
return {
|
|
96
|
+
summary: 'Not Maven compiler output',
|
|
97
|
+
totalErrors: 0,
|
|
98
|
+
errors: [],
|
|
99
|
+
metadata: {
|
|
100
|
+
detection: {
|
|
101
|
+
extractor: 'maven-compiler',
|
|
102
|
+
confidence: detection.confidence,
|
|
103
|
+
patterns: detection.patterns,
|
|
104
|
+
reason: detection.reason,
|
|
105
|
+
},
|
|
106
|
+
confidence: detection.confidence,
|
|
107
|
+
completeness: 100,
|
|
108
|
+
issues: [],
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const compilationErrors = [];
|
|
113
|
+
const lines = output.split('\n');
|
|
114
|
+
// Parse error lines
|
|
115
|
+
for (let i = 0; i < lines.length; i++) {
|
|
116
|
+
const line = lines[i];
|
|
117
|
+
const match = COMPILER_PATTERNS.errorLine.exec(line);
|
|
118
|
+
if (match) {
|
|
119
|
+
const [, filePath, lineStr, colStr, message] = match;
|
|
120
|
+
// Collect additional context (symbol, location) from next lines
|
|
121
|
+
const contextLines = [];
|
|
122
|
+
for (let j = i + 1; j < Math.min(i + 5, lines.length); j++) {
|
|
123
|
+
const nextLine = lines[j]?.trim();
|
|
124
|
+
if (nextLine && !nextLine.startsWith('[') && (nextLine.startsWith('symbol:') || nextLine.startsWith('location:'))) {
|
|
125
|
+
contextLines.push(nextLine);
|
|
126
|
+
}
|
|
127
|
+
else if (nextLine?.startsWith('[')) {
|
|
128
|
+
// Hit next Maven log line
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const fullMessage = contextLines.length > 0
|
|
133
|
+
? `${message}\n${contextLines.join('\n')}`
|
|
134
|
+
: message;
|
|
135
|
+
compilationErrors.push({
|
|
136
|
+
file: extractRelativePath(filePath),
|
|
137
|
+
line: Number.parseInt(lineStr, 10),
|
|
138
|
+
column: colStr ? Number.parseInt(colStr, 10) : undefined,
|
|
139
|
+
message: fullMessage.trim(),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Remove duplicates (Maven sometimes reports errors twice)
|
|
144
|
+
const uniqueErrors = deduplicateErrors(compilationErrors);
|
|
145
|
+
// Convert to FormattedError format
|
|
146
|
+
const errors = uniqueErrors.slice(0, MAX_ERRORS_IN_ARRAY).map((e) => ({
|
|
147
|
+
file: e.file,
|
|
148
|
+
line: e.line,
|
|
149
|
+
column: e.column,
|
|
150
|
+
message: e.message,
|
|
151
|
+
}));
|
|
152
|
+
// Group by file for summary
|
|
153
|
+
const fileGroups = groupByFile(uniqueErrors);
|
|
154
|
+
const summary = `${uniqueErrors.length} compilation error(s) in ${fileGroups.size} file(s)`;
|
|
155
|
+
// Generate guidance
|
|
156
|
+
const guidance = uniqueErrors.length > 0
|
|
157
|
+
? `Fix Java compilation errors. Run ${command ?? 'mvn compile'} to see all details.`
|
|
158
|
+
: undefined;
|
|
159
|
+
// Create error summary
|
|
160
|
+
const errorSummary = errors.length > 0
|
|
161
|
+
? errors.map((e, i) => {
|
|
162
|
+
const location = e.column ? `${e.file}:${e.line}:${e.column}` : `${e.file}:${e.line}`;
|
|
163
|
+
return `[Error ${i + 1}/${errors.length}] ${location}\n${e.message}`;
|
|
164
|
+
}).join('\n\n')
|
|
165
|
+
: undefined;
|
|
166
|
+
return {
|
|
167
|
+
summary,
|
|
168
|
+
totalErrors: uniqueErrors.length,
|
|
169
|
+
errors,
|
|
170
|
+
guidance,
|
|
171
|
+
errorSummary,
|
|
172
|
+
metadata: {
|
|
173
|
+
detection: {
|
|
174
|
+
extractor: 'maven-compiler',
|
|
175
|
+
confidence: detection.confidence,
|
|
176
|
+
patterns: detection.patterns,
|
|
177
|
+
reason: detection.reason,
|
|
178
|
+
},
|
|
179
|
+
confidence: 100,
|
|
180
|
+
completeness: 100,
|
|
181
|
+
issues: [],
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
// Relative path extraction moved to maven-utils.ts (shared with maven-checkstyle-extractor)
|
|
186
|
+
/**
|
|
187
|
+
* Deduplicate compilation errors
|
|
188
|
+
*/
|
|
189
|
+
function deduplicateErrors(errors) {
|
|
190
|
+
const seen = new Set();
|
|
191
|
+
const unique = [];
|
|
192
|
+
for (const e of errors) {
|
|
193
|
+
const key = `${e.file}:${e.line}:${e.column}:${e.message.split('\n')[0]}`;
|
|
194
|
+
if (!seen.has(key)) {
|
|
195
|
+
seen.add(key);
|
|
196
|
+
unique.push(e);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return unique;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Group errors by file
|
|
203
|
+
*/
|
|
204
|
+
function groupByFile(errors) {
|
|
205
|
+
const groups = new Map();
|
|
206
|
+
for (const error of errors) {
|
|
207
|
+
const file = error.file || 'unknown';
|
|
208
|
+
if (!groups.has(file)) {
|
|
209
|
+
groups.set(file, []);
|
|
210
|
+
}
|
|
211
|
+
const group = groups.get(file);
|
|
212
|
+
if (group) {
|
|
213
|
+
group.push(error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return groups;
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=maven-compiler-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maven-compiler-extractor.js","sourceRoot":"","sources":["../src/maven-compiler-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAqBvD,MAAM,iBAAiB,GAAG;IACxB,yDAAyD;IACzD,gHAAgH;IAChH,SAAS,EAAE,mDAAmD;IAE9D,wCAAwC;IACxC,sBAAsB,EAAE,oCAAoC;IAC5D,oBAAoB,EAAE,uBA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,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,MAA0B;IAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IAErD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvB,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maven Surefire/Failsafe (JUnit) error extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts test failures from Maven Surefire and Failsafe plugin output.
|
|
5
|
+
* Supports JUnit 4, JUnit 5, and AssertJ assertion failures.
|
|
6
|
+
*/
|
|
7
|
+
import type { ErrorExtractorResult } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Detects if output is from Maven Surefire/Failsafe
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectMavenSurefire(output: string): {
|
|
12
|
+
confidence: number;
|
|
13
|
+
patterns: string[];
|
|
14
|
+
reason: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Extracts test failures from Maven Surefire/Failsafe output
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractMavenSurefire(output: string, command?: string): ErrorExtractorResult;
|
|
20
|
+
//# sourceMappingURL=maven-surefire-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maven-surefire-extractor.d.ts","sourceRoot":"","sources":["../src/maven-surefire-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,YAAY,CAAC;AAkCvE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CA2CA;AAED;;GAEG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,oBAAoB,CAsLtB"}
|