Skip to content
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

Exceptions for Spacing rule not working #894

Open
1 task done
j-wol opened this issue Sep 4, 2024 · 0 comments
Open
1 task done

Exceptions for Spacing rule not working #894

j-wol opened this issue Sep 4, 2024 · 0 comments

Comments

@j-wol
Copy link

j-wol commented Sep 4, 2024

Check for existing issues

  • Completed

Environment

OS: Ubuntu Linux
Install method: direct download
Vale version: 3.3.0

Describe the bug / provide steps to reproduce it

In my setup I make use of the following Spacing rule that warns when a dot is not followed by a space.

extends: existence
message: "'%s' should have one space."
level: warning
nonword: true

tokens:

  • '[a-z][.][A-Z]'

Unfortunately, this rule introduces some false positives when a mail address in the form "[email protected]" is present in the documents.

My first idea to overcome that was to make use of the "exceptions" key of the existence style:

exceptions:

  • '\S+@\S+$'

Unfortunately, that has no impact and filters nothing. I searched a bit for such issues and found this commit which (when I interpret it correctly) removed the usage of the "exceptions" key. In case my interpretation in correct, I would suggest to adopt the documentation accordingly. Otherwise, please let me know how to properly formulate exceptions.

My second try to filter out such mail addresses was to make use a Vocabulary. The newly introduced Vocabulary simply consists of a accept.txt with following entry:

'\S+@\S+$'

This has no impact as well.
Then I tested a bit and put the regex in square brackets:

[\S+@\S+$]

That now unfortunately, filter out all previous findings from the Spacing rule, even valid ones like "... end of last sentence.New sentence".

Could you please provide some hints, how to exclude mail addresses of the form "[email protected]"?

@j-wol j-wol added the Type: Bug label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant