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
In case a relatively complex rule doesn't handle ignorecase: true well, I also tried to write more explicit rules but I still couldn't reach and change "mpl 2.0". The rule performs well with the other examples, could it be that with ignorecase: true, complicated rule corrections are also taken with ignorecase?
Alternatively, is there a syntax issue in the rule that I'm missing?
The text was updated successfully, but these errors were encountered:
alexvonme
changed the title
Substitution and "ignorecase: true" doesn't produce the expected result
Substitution with "ignorecase: true" doesn't produce the expected result
Jul 23, 2024
My earlier description may not have been sufficiently descriptive. In an ignorecase:true substitution rule where there are the following swap operations:
MPL: MPL
MPL[ -]?2(?:\.0)?: MPL 2.0
All incorrect capitalization of MPL, such as mpl, Mpl or mpL are corrected to MPL.
However, incorrect capitalizations of MPL 2.0, such as mpl 2.0, Mpl 2.0 or mpL 2.0 are not corrected. This isn't explained by the regex search string in the left side not functioning with ignorecase since something like mpl 2 is still corrected.
Changing the rule so that it explicitly targets mpl 2.0, as shown below, still doesn't lead to Vale correcting it.
(?:mpl|MPL)[ -]?2(?:\.0)?: MPL 2.0
These lead me to conclude that in substitution rules that utilize ignorecase:true, with swap options that include special characters, the corrections also become case insensitive.
Check for existing issues
Environment
Linux
Vale Studio
Describe the bug / provide steps to reproduce it
I wanted to create a rule that corrects miswritten versions for the abbreviation of Mozilla Public License (MPL):
However, the rule doesn't correct "mpl 2.0" regardless of any changes I've made to it. The results are:
In case a relatively complex rule doesn't handle
ignorecase: true
well, I also tried to write more explicit rules but I still couldn't reach and change "mpl 2.0". The rule performs well with the other examples, could it be that withignorecase: true
, complicated rule corrections are also taken with ignorecase?Alternatively, is there a syntax issue in the rule that I'm missing?
The text was updated successfully, but these errors were encountered: