Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/commands/flow/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export default class Scan extends SfCommand<ScanResult> {
description: "Comma-separated list of source flow paths to scan",
required: false,
multiple: false,
deprecated: {
to: "files",
message:
"Please use --files instead of --path, as --path will be deprecated",
},
}),
files: Flags.file({
multiple: true,
Expand Down Expand Up @@ -111,7 +116,6 @@ export default class Scan extends SfCommand<ScanResult> {

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

// Build results
const results = this.buildResults(scanResults);
Expand All @@ -130,6 +134,8 @@ export default class Scan extends SfCommand<ScanResult> {
"Flow: " +
chalk.yellow(resultKey) +
" " +
chalk.bgYellow(`(${matchingScanResult.flow.name}.flow-meta.xml)`) +
" " +
chalk.red("(" + resultsByFlow[resultKey].length + " results)"),
);
this.log(chalk.italic("Type: " + matchingScanResult.flow.type));
Expand Down Expand Up @@ -207,16 +213,6 @@ export default class Scan extends SfCommand<ScanResult> {
flowFiles = FindFlows(directory);
} else if (sourcepath) {
if (typeof sourcepath === "string") {
this.log(chalk.cyanBright("********"));
this.log("");
this.log(
chalk.yellowBright(
"WARN: flag --path or -p will be deprecated, please use --files to scan flow source files",
),
);
this.log("");
this.log(chalk.cyanBright("********"));
this.log("");
flowFiles = sourcepath.split(",").filter((f) => fse.exists(f));
} else {
flowFiles = sourcepath;
Expand Down Expand Up @@ -265,13 +261,17 @@ export default class Scan extends SfCommand<ScanResult> {
ruleResult.details.length > 0
) {
const severity = ruleResult.severity || "error";
const flowUri = scanResult.flow.fsPath;
const flowApiName = `${scanResult.flow.name}.flow-meta.xml`;
for (const result of ruleResult.details as ResultDetails[]) {
const detailObj = Object.assign(result, {
ruleDescription,
rule,
flowName,
flowType,
severity,
flowUri,
flowApiName,
});
errors.push(detailObj);
this.errorCounters[severity] =
Expand Down