Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions messages/org.json

This file was deleted.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "flowhealthcheck-cli",
"version": "0.0.0",
"name": "lightningflowscan-cli",
"version": "0.0.3",
"author": "Ruben",
"bugs": "https://github.com/IdeaProjects/flowhealthcheck-cli/issues",
"type": "module",
"bugs": "https://github.com/Force-Config-Control/lightningflowscan-cli/issues",
"dependencies": {
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/errors": "^1",
"@salesforce/command": "^2",
"@salesforce/core": "^2",
"@sinonjs/fake-timers": "6",
"@types/sinonjs__fake-timers": "6",
"lightningflowscan-core": "^1.1.1",
"mz": "^2.7.0",
"tslib": "^1",
"xml2js": "^0.4.23"
},
Expand All @@ -21,8 +21,8 @@
"@oclif/test": "^1",
"@salesforce/dev-config": "1.4.1",
"@types/chai": "^4",
"@types/jsforce": "^1.9.30",
"@types/mocha": "^5",
"@types/node": "^10",
"chai": "^4",
"globby": "^8",
"mocha": "^5",
Expand All @@ -39,7 +39,7 @@
"/npm-shrinkwrap.json",
"/oclif.manifest.json"
],
"homepage": "https://github.com/IdeaProjects/flowhealthcheck-cli",
"homepage": "https://github.com/Force-Config-Control/lightningflowscan-cli/",
"keywords": [
"sfdx-plugin"
],
Expand All @@ -56,7 +56,7 @@
"@oclif/plugin-help"
]
},
"repository": "https://github.com/IdeaProjects/flowhealthcheck-cli",
"repository": "https://github.com/Force-Config-Control/lightningflowscan-cli.git",
"scripts": {
"lint": "tslint --project . --config tslint.json --format stylish",
"postpack": "rm -f oclif.manifest.json",
Expand Down
16 changes: 7 additions & 9 deletions src/commands/scan/flowscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {AnyJson} from '@salesforce/ts-types';
import * as core from 'lightningflowscan-core/out';
import {Flow} from 'lightningflowscan-core/out/main/models/Flow';
import {ScanResult} from 'lightningflowscan-core/out/main/models/ScanResult';
import { Violation } from '../../models/Violation';
import {Violation} from '../../models/Violation';
import {FindFlows} from "../../libs/FindFlows";
import {ParseFlows} from "../../libs/ParseFlows";

Messages.importMessagesDirectory(__dirname);

const messages = Messages.loadMessages('flowhealthcheck-cli', 'command');
const messages = Messages.loadMessages('lightningflowscan-cli', 'command');

export default class flowscan extends SfdxCommand {

Expand All @@ -24,6 +24,7 @@ export default class flowscan extends SfdxCommand {

const path = await SfdxProject.resolveProjectPath();
const flowFiles = FindFlows(path);
// todo check for flow ignore file
const parsedFlows: Flow[] = await ParseFlows(flowFiles);
const scanResults: ScanResult[] = core.scan(parsedFlows);
const lintResults: Violation[] = [];
Expand All @@ -41,15 +42,12 @@ export default class flowscan extends SfdxCommand {
}
}
}

if (lintResults.length > 0) {
const warnings : string[] = [];
for(const lintResult of lintResults){
warnings.push('in Flow \'' + lintResult.label + '\', Rule:\''+lintResult.ruleLabel +'\' is violated ' + lintResult.numberOfViolations + ' times');
const warnings: string[] = [];
for (const lintResult of lintResults) {
warnings.push('in Flow \'' + lintResult.label + '\', Rule:\'' + lintResult.ruleLabel + '\' is violated ' + lintResult.numberOfViolations + ' times');
}

throw new SfdxError(messages.getMessage('commandDescription'), 'results',
warnings, 1);
throw new SfdxError(messages.getMessage('commandDescription'), 'results', warnings, 1);
}
// If there are no lintresults
return 0;
Expand Down
Loading