2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2020-06-30 12:47:33 +02:00
|
|
|
This rule allows the definition of custom rules using XPath expressions.
|
|
|
|
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2020-06-30 12:47:33 +02:00
|
|
|
Issues are created depending on the return value of the XPath expression. If the XPath expression returns:
|
2020-06-30 14:49:38 +02:00
|
|
|
|
2020-06-30 12:47:33 +02:00
|
|
|
* a single or list of AST nodes, then a line issue with the given message is created for each node
|
|
|
|
* a boolean, then a file issue with the given message is created only if the boolean is true
|
|
|
|
* anything else, no issue is created
|
|
|
|
|
|
|
|
Here is an example of an XPath expression to log an issue on each 'td' tag using the 'nowrap' deprecated attribute:
|
2020-06-30 14:49:38 +02:00
|
|
|
|
2020-06-30 12:47:33 +02:00
|
|
|
----
|
|
|
|
//td[@nowrap]
|
|
|
|
----
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Parameters
|
|
|
|
|
|
|
|
.filePattern
|
|
|
|
****
|
|
|
|
|
|
|
|
Files to be validated using Ant-style matching patterns.
|
|
|
|
****
|
|
|
|
.expression
|
|
|
|
****
|
|
|
|
|
|
|
|
The XPath query
|
|
|
|
****
|
|
|
|
.message
|
|
|
|
****
|
|
|
|
|
|
|
|
----
|
|
|
|
The XPath expression matches this piece of code
|
|
|
|
----
|
|
|
|
|
|
|
|
The issue message
|
|
|
|
****
|
|
|
|
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|