Skip to content

Commit 3a6e637

Browse files
committed
Show report warnings in CLI
1 parent f892b38 commit 3a6e637

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

cli/src/cli/commands/run.ts

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ export async function run(locations: string[], options: RunOptions): Promise<voi
201201
});
202202
const report = await dolos.analyzePaths(locations);
203203

204+
if (report.warnings.length > 0) {
205+
report.warnings.forEach(warn => warning(warn));
206+
}
207+
204208
const view = closestMatch(options.outputFormat, {
205209
"terminal": () => new TerminalView(report, options),
206210
"console": () => new TerminalView(report, options),

lib/src/dolos.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ export class Dolos {
141141
if (diff > 0) {
142142
warnings.push(
143143
`The language of the files was detected as ${this.language?.name} ` +
144-
`but ${diff} files were ignored because they did not have a matching extension.`
144+
`but ${diff} files were ignored because they did not have a matching extension.` +
145+
`You can override this behavior by setting the language explicitly.`
145146
);
146147
}
147148
} else {
2.55 KB
Binary file not shown.

0 commit comments

Comments
 (0)