Originally posted by **daobrien** July 25, 2024
We have the following style that works in version 3.6.1:
~~~
---
extends: substitution
message: "Use '%s' instead of '%s'."
ignorecase: false
level: error
nonword: true
action:
name: replace
swap:
'\b(?:[Ee]\.[Gg]\.)': for example
'\b(?:[Ii]\.[Ee]\.)': that is
'\b(?:[Ee][Tt][Cc]\.)': and so on
'\b(?:[Vv][Ss]\.)': versus
'\b(?:[Vv][Ss]\s)(?!Code)': versus
~~~
TL;DR Replace e.g., i.e., etc., with their expansions.
One notable exception is the last line, which ignores `VS Code`. But, in 3.7.0, this style does not match against `vs ` and I can't work out why. Did a bug sneak in? Do I need to tweak my regex a bit more (how?).
Thanks for any help.
Discussed in https://github.com/errata-ai/vale/discussions/877