Skip to content

Commit ebfd6bf

Browse files
committed
feat: expose flow api name and uri #143
1 parent 5221612 commit ebfd6bf

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/commands/flow/scan.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export default class Scan extends SfCommand<ScanResult> {
7171
description: "Comma-separated list of source flow paths to scan",
7272
required: false,
7373
multiple: false,
74+
deprecated: {
75+
to: "files",
76+
message:
77+
"Please use --files instead of --path, as --path will be deprecated",
78+
},
7479
}),
7580
files: Flags.file({
7681
multiple: true,
@@ -111,7 +116,6 @@ export default class Scan extends SfCommand<ScanResult> {
111116

112117
this.debug(`scan results: ${scanResults.length}`, ...scanResults);
113118
this.spinner.stop(`Scan complete`);
114-
this.log("");
115119

116120
// Build results
117121
const results = this.buildResults(scanResults);
@@ -130,6 +134,8 @@ export default class Scan extends SfCommand<ScanResult> {
130134
"Flow: " +
131135
chalk.yellow(resultKey) +
132136
" " +
137+
chalk.bgYellow(`(${matchingScanResult.flow.name}.flow-meta.xml)`) +
138+
" " +
133139
chalk.red("(" + resultsByFlow[resultKey].length + " results)"),
134140
);
135141
this.log(chalk.italic("Type: " + matchingScanResult.flow.type));
@@ -207,16 +213,6 @@ export default class Scan extends SfCommand<ScanResult> {
207213
flowFiles = FindFlows(directory);
208214
} else if (sourcepath) {
209215
if (typeof sourcepath === "string") {
210-
this.log(chalk.cyanBright("********"));
211-
this.log("");
212-
this.log(
213-
chalk.yellowBright(
214-
"WARN: flag --path or -p will be deprecated, please use --files to scan flow source files",
215-
),
216-
);
217-
this.log("");
218-
this.log(chalk.cyanBright("********"));
219-
this.log("");
220216
flowFiles = sourcepath.split(",").filter((f) => fse.exists(f));
221217
} else {
222218
flowFiles = sourcepath;
@@ -265,13 +261,17 @@ export default class Scan extends SfCommand<ScanResult> {
265261
ruleResult.details.length > 0
266262
) {
267263
const severity = ruleResult.severity || "error";
264+
const flowUri = scanResult.flow.fsPath;
265+
const flowApiName = `${scanResult.flow.name}.flow-meta.xml`;
268266
for (const result of ruleResult.details as ResultDetails[]) {
269267
const detailObj = Object.assign(result, {
270268
ruleDescription,
271269
rule,
272270
flowName,
273271
flowType,
274272
severity,
273+
flowUri,
274+
flowApiName,
275275
});
276276
errors.push(detailObj);
277277
this.errorCounters[severity] =

0 commit comments

Comments
 (0)