Closed pujson6767 closed 6 months ago
@pujson6767 Sorry for my slow response. First of all, my compliments in your efforts to debug, I know its not easy! It sees your configuration is correct so I am not sure what is going on. I will try to reproduce this in the coming days. Do you use the latest version?
I was use lightning-flow-scanner 2.18.0 (which is using lightning-flow-scanner-core 2.28.0)
@pujson6767 I managed to find the issue and included a fix with the latest version of the core. I will soon publish this in both the sfdx and vsce solutions.
Thank You! By the way, while I was using lightning-flow-scanner, I noticed that these properties in the JSON output can be useful:
"line" / "lineNumber": line number of file where violation occurred. I know it's hard to define exactly which line an issue belongs to, but it would be useful for adding comments on violation PRs indicating on which line the issue occurs.
"flowFileName": There is already "flowName" which is a Label of flow. In Salesforce, it is possible to use the same labels for flows (although it is known that this is not recommended). In large SF orgs, it sometimes happens that there are the same flow labels within the organization. After running the flow-scanner, from the output, it is not clear which "flowName" belongs to which flow.
I was used .flowScanner.json file the same mentioned in example
And files from example repository: Outdated_API_Version.flow-meta.xml, here I added only apiVersion tag compare to your example
FlowNamingConvention.flow-meta.xml
Command what I used
sfdx flow:scan --directory force-app/main/default/flows --json --config ./.flow-scanner.json
Result:
As we can see, there should be only 2 violations found, there are 3, also in details.expression there are always expression from first rule. I was tried to debug rules/APIVersion.js and rules/FlowName.js files from your npm package, and it's looking like always first expression "<58" is taken to APIVersion.js file but also for FlowName.js
Also, when config file not contain expression for FlowName the same wrong result appear.
I would be grateful for an answer if maybe it is not a problem with the wrong creation of flowScanner.json, although I used the same as in the example. I hope the errors can be fixed