Replies: 1 comment
-
Resolved in #680. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently in script based rules a match must be a map with the keys
begin
andend
set to integer indexes into the scope. When displaying the error message vale uses themessage
field of the rule definition.Script based rules could be made more powerful and versatile if the returned match could also have an optional custom message set per match.
A match could be added to the matches array like this
Any match with a custom
message
set would be displayed using this message, matches without this property set would display the default message of the rule like it is handled today.This way a single script could be ran across the file and check for a a class or errors in the file and report a meaningful case by case error message. Currently the script based rule would have to be copied multiple times and slightly altered in each version to detect the concrete error case. This would also make vale run the almost identical script over any given input files multiple times.
Beta Was this translation helpful? Give feedback.
All reactions