Skip to content

Unexpected interaction between Vocab words and existence rule #1058

@aglet

Description

@aglet

Check for existing issues

  • Completed

Environment

  • macOS 26.1 (25B78)
  • installed via Homebrew
  • vale version 3.13.0

Describe the bug / provide steps to reproduce it

I've noticed some odd behaviour; when a word is in a custom vocabulary then an existence rule with that word is not applied. I've stuck some example configs below.

bug.ini

StylesPath = styles
MinAlertLevel = suggestion

Vocab = Bug

[*.md]

[bug.md](https://github.com/user-attachments/files/24054800/bug.md)

BasedOnStyles = Bug, Vale

styles/Bug/Quotes.yml

extends: existence
message: "Commas and periods go inside quotation marks."
level: warning
nonword: true
tokens:
  - '"[^"]+"[.,]'

styles/config/vocabularies/Bug/accept.txt

plugh

bug.md

# This illustrates something weird

We have added plugh as an extra word in our vocabulary, so this line is fine.

This line also does not contain any violations; the word is in our dictionary and the quotes contain the period "plugh."

On this line is a normal word in "quotes", that the Quotes rule marks as a violation as we would expect.

This is the extra word in quotes: "plugh", which should fall foul of the "Quotes" rule but does not.

Steps to reproduce / observed behaviour

vale --config bug.ini bug.md

 bug.md
 7:34  warning  Commas and periods go inside    Bug.Quotes 
                quotation marks.                           

✖ 0 errors, 1 warning and 0 suggestions in 1 file.

If the custom vocab is deactivated (comment out the Vocab = Bug line in the ini file) then the rule is applied:

vale --config bug.ini bug.md

 bug.md
 3:15   error    Did you really mean 'plugh'?    Vale.Spelling 
 5:114  error    Did you really mean 'plugh'?    Vale.Spelling 
 7:34   warning  Commas and periods go inside    Bug.Quotes    
                 quotation marks.                              
 9:35   warning  Commas and periods go inside    Bug.Quotes    
                 quotation marks.                              
 9:36   error    Did you really mean 'plugh'?    Vale.Spelling 

✖ 3 errors, 2 warnings and 0 suggestions in 1 file.

Expected behaviour

Quote rule gets applied to all words including ones in custom vocab.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions