Skip to content

Commit 83a6ed6

Browse files
committed
update configuration section
1 parent 8c84fdf commit 83a6ed6

File tree

1 file changed

+15
-55
lines changed

1 file changed

+15
-55
lines changed

README.md

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
<img src="docs/images/banner.png" style="width: 41%;" />
44
</a>
55
</p>
6-
<p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize your Salesforce Flows</i></p>
6+
7+
<p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize Salesforce Flows</i></p>
78

89
![FlowScan example](docs/images/sfdxgif.gif)
910

1011
- **[Installation](#installation)**
1112
- **[Usage](#usage)**
1213
- **[Configuration](#configuration)**
13-
- [Defining the severity per rule](#defining-the-severity-per-rule)
14-
- [Configuring an expression](#configuring-an-expression)
15-
- [Specifying an exception](#specifying-an-exception)
1614
- **[Development](#development)**
1715

1816
## Installation
@@ -58,78 +56,40 @@ Customize the scan behavior using the following options:
5856

5957
## Configuration
6058

61-
Create a .flow-scanner.json file in order to configure:
59+
It is recommended to set up configuration and define:
6260

63-
- A defined ruleset to be executed.
61+
- The rules to be executed.
6462
- The severity of violating any specific rule.
65-
- Custom expressions or rule implementations.
63+
- Rule properties such as REGEX expressions.
6664
- Any known exceptions that should be ignored during scanning.
6765

68-
```json
69-
{
70-
"rules": {
71-
...
72-
},
73-
"exceptions": {
74-
...
75-
}
76-
}
77-
```
78-
79-
_Note: if you prefer YAML format, you can create a `.flow-scanner.yml` file using the same format._
80-
81-
### Defining the severity per rule
82-
83-
When the severity is not provided it will be `error` by default. Other available values for severity are `warning` and `note`. Define the severity per rule as shown in the following example.
84-
8566
```json
8667
{
8768
"rules": {
88-
"FlowDescription": {
89-
"severity": "warning"
90-
},
91-
"UnusedVariable": {
92-
"severity": "error"
93-
}
69+
// Your rules here
70+
},
71+
"exceptions": {
72+
// Your exceptions here
9473
}
9574
}
9675
```
9776

98-
### Configuring an expression
99-
100-
Some rules have additional attributes to configure, such as the expression, that will overwrite default values. These can be configured in the same way as severity as shown in the following example. For more information on the available rules and configurations, please review the [flow scanner documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/).
77+
Using the rules section of your configurations, you can specify the list of rules to be run. Furthermore, you can define the severity and configure expressions of rules. To include rules currently that are currently in beta, set `betarules` to true. Below is a breakdown of the available attributes of rule configuration:
10178

10279
```json
10380
{
10481
"rules": {
105-
"APIVersion": {
106-
"severity": "error",
107-
"expression": "===58"
108-
},
109-
"FlowName": {
110-
"severity": "error",
111-
"expression": "[A-Za-z0-9]"
82+
"<RuleName>": {
83+
"severity": "<Severity>",
84+
"expression": "<Expression>"
11285
}
11386
}
11487
}
11588
```
11689

117-
### Specifying an exception
118-
119-
Specifying exceptions can be done by flow, rule and result(s), as shown in the following example.
90+
Note: if you prefer YAML format, you can create a `.flow-scanner.yml` file using the same format. For a more on configurations, review the [scanner documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/#configurations).
12091

121-
```json
122-
{
123-
"exceptions": {
124-
"AssignTaskOwner": {
125-
"UnusedVariable": ["somecount"]
126-
},
127-
"GetAccounts": {
128-
"UnusedVariable": ["incvar"]
129-
}
130-
}
131-
}
132-
```
92+
---
13393

13494
## Development
13595

0 commit comments

Comments
 (0)