New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to match backticks in styles? #43
Comments
Does vale actually just ignore the backticks, quotation marks, and other "surrounding stuff"? |
By default, Vale ignores the syntax equivalent of For example, given a Markdown file with the following contents:
and this rule definition: # Named Back.yml
extends: substitution
message: Consider using '%s' instead of '%s'
level: warning
nonword: true # "`" is a non-word character
swap:
'for loop': for-loop
'`for` loop': for-loop Running
And
In a future build, I'd like to add an |
OK, thanks for the details. That works well for me. Should I close this out, or do you want to keep it open? |
I'll leave it open until I get around to improving the documentation on the command line flags. |
I've added a new option to make code spans available on a per-rule basis (see #44). So, the updated definition would be: extends: substitution
message: Consider using '%s' instead of '%s'
level: warning
nonword: true
code: true
swap:
'for loop': for-loop
'`for` loop': for-loop And you can run normally (without (Updated docs are also forthcoming.) |
Brilliant, thanks! |
I think I'm just being dense, but I can't figure out how to match backticks ("`" characters) in a swap rule. I'm linting a book on Python, and we want to standardize how we spell e.g. "for-loop". So I want a rule like this (simplified from what we really want):
But this doesn't seem to work. The first rule works just fine, but the second one with backticks doesn't seem to fire. How can I make this work?
The text was updated successfully, but these errors were encountered: