|
3 | 3 | <img src="docs/images/banner.png" style="width: 41%;" /> |
4 | 4 | </a> |
5 | 5 | </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> |
7 | 8 |
|
8 | 9 |  |
9 | 10 |
|
10 | 11 | - **[Installation](#installation)** |
11 | 12 | - **[Usage](#usage)** |
12 | 13 | - **[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) |
16 | 14 | - **[Development](#development)** |
17 | 15 |
|
18 | 16 | ## Installation |
@@ -58,78 +56,40 @@ Customize the scan behavior using the following options: |
58 | 56 |
|
59 | 57 | ## Configuration |
60 | 58 |
|
61 | | -Create a .flow-scanner.json file in order to configure: |
| 59 | +It is recommended to set up configuration and define: |
62 | 60 |
|
63 | | -- A defined ruleset to be executed. |
| 61 | +- The rules to be executed. |
64 | 62 | - The severity of violating any specific rule. |
65 | | -- Custom expressions or rule implementations. |
| 63 | +- Rule properties such as REGEX expressions. |
66 | 64 | - Any known exceptions that should be ignored during scanning. |
67 | 65 |
|
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 | | - |
85 | 66 | ```json |
86 | 67 | { |
87 | 68 | "rules": { |
88 | | - "FlowDescription": { |
89 | | - "severity": "warning" |
90 | | - }, |
91 | | - "UnusedVariable": { |
92 | | - "severity": "error" |
93 | | - } |
| 69 | + // Your rules here |
| 70 | + }, |
| 71 | + "exceptions": { |
| 72 | + // Your exceptions here |
94 | 73 | } |
95 | 74 | } |
96 | 75 | ``` |
97 | 76 |
|
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: |
101 | 78 |
|
102 | 79 | ```json |
103 | 80 | { |
104 | 81 | "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>" |
112 | 85 | } |
113 | 86 | } |
114 | 87 | } |
115 | 88 | ``` |
116 | 89 |
|
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). |
120 | 91 |
|
121 | | -```json |
122 | | -{ |
123 | | - "exceptions": { |
124 | | - "AssignTaskOwner": { |
125 | | - "UnusedVariable": ["somecount"] |
126 | | - }, |
127 | | - "GetAccounts": { |
128 | | - "UnusedVariable": ["incvar"] |
129 | | - } |
130 | | - } |
131 | | -} |
132 | | -``` |
| 92 | +--- |
133 | 93 |
|
134 | 94 | ## Development |
135 | 95 |
|
|
0 commit comments