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/create-first-yaml-rule.adoc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
//
3
3
// * docs/rules-development-guide/master.adoc
4
4
5
-
:_content-type: PROCEDURE
5
+
:_mod-docs-content-type: PROCEDURE
6
6
[id="create-first-yaml-rule_{context}"]
7
7
= Creating your first YAML rule
8
8
@@ -13,7 +13,7 @@ In this example, you will create a rule to discover instances where an applicati
13
13
[id="creating-yaml-file-for-the-rule_{context}"]
14
14
== Creating a YAML file for the rule
15
15
16
-
Create a YAML file for your first rule.
16
+
* Create a YAML file for your first rule.
17
17
18
18
[options="nowrap",subs="attributes+"]
19
19
----
@@ -82,7 +82,7 @@ when(condition)
82
82
83
83
.Procedure
84
84
85
-
. In the `rule.yaml` file you created, paste the following contents:
85
+
* In the `rule.yaml` file you created, paste the following contents:
86
86
+
87
87
[options="nowrap",subs="attributes+"]
88
88
----
@@ -97,10 +97,10 @@ when(condition)
97
97
- <LINKS> <7>
98
98
----
99
99
+
100
-
<1> Unique ID for your rule, for instance, `jboss5-web-class-loading`.
100
+
<1> Unique ID for your rule. For example, `jboss5-web-class-loading`.
101
101
<2> Text description of the rule.
102
102
<3> Complete the `when` block specifying one or more conditions:
103
-
.. Use the `builtin` provider’s XML capability because this rule checks for a match in an XML file.
103
+
.. Use the `builtin` provider's XML capability because this rule checks for a match in an XML file.
104
104
.. To match on the `class-loading` element that is a child of `jboss-web`, use the XPath expression `jboss-web/web-loading` as an XML query. In this case, you need just one condition:
105
105
+
106
106
[options="nowrap",subs="attributes+"]
@@ -146,7 +146,7 @@ The rule is now complete and looks similar to the following:
Copy file name to clipboardExpand all lines: docs/topics/testing-rules.adoc
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
//
3
3
// * docs/rules-development-guide/master.adoc
4
4
5
-
:_content-type: REFERENCE
5
+
:_mod-docs-content-type: REFERENCE
6
6
[id="testing-rules_{context}"]
7
7
= Testing XML rules
8
8
@@ -17,7 +17,7 @@ Test rules are created using a process similar to the process for creating an XM
17
17
* Test rules should use the `.windup.test.xml` extension.
18
18
* These rules use the structure defined in the Test XML Rule Structure.
19
19
20
-
In addition, it is recommended to create a test rule that follows the name of the rule it tests. For instance, if a rule were created with a filename of `proprietary-rule.{LC_PSN}.xml`, the test rule should be called `proprietary-rule.windup.test.xml`.
20
+
In addition, it is recommended to create a test rule that follows the name of the rule it tests. For example, if a rule were created with a filename of `proprietary-rule.{LC_PSN}.xml`, the test rule should be called `proprietary-rule.windup.test.xml`.
21
21
22
22
[id="test-xml-rule-structure_{context}"]
23
23
=== Test XML rule structure
@@ -99,7 +99,7 @@ The `<not>` element has no unique attributes or child elements.
99
99
[discrete]
100
100
===== Summary
101
101
102
-
The `<iterable-filter>` element counts the number of times a condition is verified. For additional information, see the link:{LinkAPI}org/jboss/windup/rules/general/IterableFilter.html[IterableFilter] class.
102
+
The `<iterable-filter>` element counts the number of times a condition is verified. For additional information, see the link:{LinkAPI}rules-base/api/src/main/java/org/jboss/windup/rules/general/IterableFilter.java[IterableFilter] class.
103
103
104
104
The following is an example that looks for four instances of the specified message.
105
105
@@ -158,7 +158,7 @@ The `<iterable-filter>` element has no unique child elements.
158
158
[id="classification_exists_syntax_{context}"]
159
159
==== <classification-exists> syntax
160
160
161
-
The `<classification-exists>` element determines if a specific classification title has been included in the analysis. For additional information, see the link:{LinkAPI}org/jboss/windup/reporting/config/ClassificationExists.html[ClassificationExists] class.
161
+
The `<classification-exists>` element determines if a specific classification title has been included in the analysis. For additional information, see the link:{LinkAPI}reporting/api/src/main/java/org/jboss/windup/reporting/config/ClassificationExists.java[ClassificationExists] class.
162
162
163
163
[IMPORTANT]
164
164
====
@@ -226,7 +226,8 @@ The `<classification-exists>` has no unique child elements.
226
226
[id="hint-exists-syntax_{context}"]
227
227
==== <hint-exists> syntax
228
228
229
-
The `<hint-exists>` element determines if a specific hint has been included in the analysis. It searches for any instances of the defined message, and is typically used to search for the beginning or a specific class inside of a `<message>` element. For additional information, see the link:{LinkAPI}org/jboss/windup/reporting/config/HintExists.html[HintExists] class.
229
+
The `<hint-exists>` element determines if a specific hint has been included in the analysis. It searches for any instances of the defined message, and is typically used to search for the beginning or a specific class inside of a `<message>` element. For additional information, see the link:{LinkAPI}reporting/api/src/main/java/org/jboss/windup/reporting/config/HintExists.java[HintExists] class.
Copy file name to clipboardExpand all lines: docs/topics/yaml-rule-structure-syntax.adoc
+21-25Lines changed: 21 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
//
3
3
// * docs/rules-development-guide/master.adoc
4
4
5
-
:_content-type: REFERENCE
5
+
:_mod-docs-content-type: REFERENCE
6
6
[id="yaml-rule-structure-syntax_{context}"]
7
7
= YAML rule structure and syntax
8
8
@@ -31,11 +31,8 @@ effort: 1 <3>
31
31
category: mandatory <4>
32
32
----
33
33
<1> The ID must be unique within the ruleset to which the rule belongs.
34
-
35
34
<2> See below for a description of the label format.
36
-
37
35
<3> `effort` is an integer value that indicates the level of effort needed to fix this issue.
38
-
39
36
<4> `category` describes the severity of the issue for migration. The value can be either `mandatory`, `optional` or `potential`. For a description of these categories, see xref:yaml-rule-categories_{context}[Rule categories].
40
37
41
38
[id="yaml-rule-labels_{context}"]
@@ -118,7 +115,7 @@ _Examples:_
118
115
119
116
.Dependency labels
120
117
121
-
The analyzer engine adds labels to dependencies. These labels provide additional information about a dependency, such as its programming language and whether the dependency is open-source or internal.
118
+
The analyzer engine adds labels to dependencies. These labels provide additional information about a dependency, such as its programming language and whether the dependency is opensource or internal.
122
119
123
120
Currently, the analyzer adds the following labels to dependencies:
124
121
@@ -133,9 +130,9 @@ labels:
133
130
134
131
The analyzer CLI accepts the `--dep-label-selector` option, which allows filtering-in or filtering-out incidents generated from a dependency by their labels.
135
132
136
-
For example, the analyzer adds a `konveyor.io/dep-source` label to dependencies with a value that indicates whether the dependency is a known open-source dependency.
133
+
For example, the analyzer adds a `konveyor.io/dep-source` label to dependencies with a value that indicates whether the dependency is a known opensource dependency.
137
134
138
-
To exclude incidents for all such open-source dependencies, you can use `--dep-label-selector` as follows:
135
+
To exclude incidents for all such opensource dependencies, you can use `--dep-label-selector` as follows:
{ProductShortName} supports multi-language source code analysis. Searching for a specific language in the source code is enabled using the `provider` condition. This condition defines a search query for a specific language provider. The `provider` condition also specifies which of the provider's "capabilities" to use for analyzing the code.
233
+
{ProductShortName} supports multi-language source code analysis. Searching for a specific language in the source code is enabled using the `provider` condition. This condition defines a search query for a specific language provider. The `provider` condition also specifies which of the provider's "capabilities" to use for analyzing the code.
237
234
238
235
The `provider` condition has the form `<provider_name>.<capability>`:
239
236
@@ -320,12 +317,12 @@ The `hasTags` capability enables the provider to query application tags. It quer
320
317
[source,terminal]
321
318
----
322
319
when:
323
-
# when more than one tags are given, a logical AND is implied
320
+
# when more than one tag is given, a logical AND is implied
324
321
hasTags: <1>
325
322
- "tag1"
326
323
- "tag2"
327
324
----
328
-
<1> When more than one tags is given, a logical AND is implied.
325
+
<1> When more than one tag is given, a logical AND is implied.
<1> A RegEx pattern to match, for example, `org.kubernetes.*`
351
-
<2> Specifies the exact location where the pattern needs to be matched, for example, `IMPORT`
347
+
<1> A regular expression pattern to match, for example, `org.kubernetes.*`.
348
+
<2> Specifies the exact location where the pattern needs to be matched, for example, `IMPORT`.
352
349
353
350
The supported locations are the following:
354
351
@@ -375,13 +372,13 @@ when:
375
372
upperbound: "<version_string>" <2>
376
373
lowerbound: "<version_string>" <3>
377
374
----
378
-
<1> Name of the dependency to search for
379
-
<2> Upper bound on the version of the dependency
380
-
<3> Lower bound on the version of the dependency
375
+
<1> Name of the dependency to search for.
376
+
<2> Upper bound on the version of the dependency.
377
+
<3> Lower bound on the version of the dependency.
381
378
382
379
===== `go` provider
383
380
384
-
The `go` provider analyzes Go source code. This provider's capabilities are `referenced` and `dependency`.
381
+
The `go` provider analyzes Go source code. This provider's capabilities are `referenced` and `dependency`.
385
382
386
383
.`referenced`
387
384
@@ -405,13 +402,13 @@ when:
405
402
upperbound: "<version_string>" <2>
406
403
lowerbound: "<version_string>" <3>
407
404
----
408
-
<1> Name of the dependency to search for
409
-
<2> Upper bound on the version of the dependency
410
-
<3> Lower bound on the version of the dependency
405
+
<1> Name of the dependency to search for.
406
+
<2> Upper bound on the version of the dependency.
407
+
<3> Lower bound on the version of the dependency.
411
408
412
409
==== Custom variables
413
410
414
-
Provider conditions can have associated custom variables. You can use custom variables to capture relevant information from the matched line in the source code. The values of these variables are interpolated with data matched in the source code. These values can be used to generate detailed templated messages in a rule’s action (see xref:yaml-rule-actions_{context}[Message actions]). They can be added to a rule in the `customVariables` field:
411
+
Provider conditions can have associated custom variables. You can use custom variables to capture relevant information from the matched line in the source code. The values of these variables are interpolated with data matched in the source code. These values can be used to generate detailed templated messages in a rule's action (see xref:yaml-rule-actions_{context}[Message actions]). They can be added to a rule in the `customVariables` field:
415
412
416
413
[source,terminal]
417
414
----
@@ -426,9 +423,9 @@ Provider conditions can have associated custom variables. You can use custom var
426
423
pattern: com.example.apps.GenericClass.get
427
424
428
425
----
429
-
<1> `pattern`: A RegEx pattern that is matched on the source code line when a match is found
430
-
<2> `name`: The name of the variable that can be used in templates
431
-
<3> `message`: A template for a message using a custom variable
426
+
<1> `pattern`: A regular expression pattern that is matched on the source code line when a match is found.
427
+
<2> `name`: The name of the variable that can be used in templates.
428
+
<3> `message`: A template for a message using a custom variable.
432
429
433
430
434
431
=== Logical conditions
@@ -521,5 +518,4 @@ labels: <2>
521
518
- key=val
522
519
----
523
520
<1> The name must be unique within the provided rulesets.
524
-
525
521
<2> Ruleset labels are inherited by all rules that belong to the ruleset.
0 commit comments