You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/rules-development/yaml-rulesets.adoc
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@
4
4
5
5
:_mod-docs-content-type: REFERENCE
6
6
[id="yaml-rulesets_{context}"]
7
-
= Creating and using a ruleset
7
+
= Creating and using a custom ruleset
8
8
9
9
[role="_abstract"]
10
-
You can create a ruleset by placing one or more YAML rules in a directory and creating a `ruleset.yaml` file at the directory root. When you pass this directory as input to the {ProductShortName}{CLIName} by using the `--rules` option, all rules in this directory are treated as a part of the ruleset defined by the `ruleset.yaml` file.
10
+
You can create a ruleset by placing one or more custom rules in a directory and creating a `ruleset.yaml` file at the directory root. When you perform an analysis, you pass this directory as input to the {ProductShortName}{CLIName} by using the `--rules` option. All rules in this directory are treated as a part of the ruleset defined by the `ruleset.yaml` file.
11
11
12
-
The `ruleset.yaml` file stores the metadata of the ruleset.
12
+
The `ruleset.yaml` file stores the metadata of the ruleset. You can group multiple similar custom rules and create a ruleset for them. When you pass this directory as input to the {ProductShortName}{CLIName} using the `--rules` option, {ProductShortName} treats all the files in the directory as belonging to the ruleset defined in the `ruleset.yaml` file.
* Replace `<application_to_analyze>` with the name of your application.
34
34
* Replace `<output_dir>` with the directory of your choice.
35
-
* Replace `<custom_rule_dir>` with the custom rulesets file.
35
+
* Replace `<custom_rule_dir>` with the custom rule file.
36
+
* To use multiple rule files, you need to place them in a directory and to add a `ruleset.yaml` file. Then the directory is treated as a _ruleset_, and you can pass it as input to the `--rules` option.
37
+
+
36
38
37
-
On initiation, the mta-cli tool determines the type of application and the provider needed for analysis. It then starts the provider in a container that has the required dependencies and tools. Finally, the provider uses the analyzer to execute a series of rulesets to analyze the source code.
39
+
Note that if you want to use the `--target` or `--source` option in the CLI, the engine will only select rules that match the label for that target. Therefore, make sure that you have added target or source labels on your rules. See xref:reserved-label_rule-yaml-metadata[Reserved labels] for more details.
0 commit comments