Skip to content

TokenIgnores not working as intended? #736

@kellertuer

Description

@kellertuer

Check for existing issues

  • Completed

Environment

vale 2.30 on Mac OS (via Homebrew)

Describe the bug / provide steps to reproduce it

First of all thanks for merging the Julia extension – it seems to work quite great already on my side.

While reworking my code style a bit already I noticed two things that I can not get to work properly. Consider the following example which is Julia code to “just attach the docstring” to a function signature – but one could also implement the function instead of the last line

@doc raw"""
    DouglasRachford(M, f, proxes_f, p; kwargs...)

a doc string with some math ``t_{k+1} = g(α_k; t_k, s_k)``
"""
DouglasRachford(M, f, proxes_f, p; kwargs...)

I have two problems with this that I can not resolve.

  1. The first line (and actually any line starting with 4 spaces in such a doc string) is code and should be considered code. Currently my vale complains that rpoxes_f and kwargs are unnknown words (Vale.Spelling) and ... should not be used.
  2. math in Julia doc strings is put in 2 backticks, so I would like to also ignore these. What vale toes is complain that t_k is an unknown word (Vale.Spelling).

So in my vale.ini I did the following (extending my existing ignores), documenting them a bit in a comment)

[*.{md,jl}]
BasedOnStyles = Vale, Google

; ignore (1) math (2) ref and cite keys (3) code in docs (4) math in docs (5,6) indented blocks
TokenIgnores = \
    \$.+?\$, \
    \[.+\]\(@(ref|id|cite).+?\), \
    `.+`, \
    ``.+``, \
    ^\s{4}.+$ \

where the second to last is meant to capture the math above, and the last meant to capture the code block line. But neither of them seems to have an effect. Am I doing the TokenIgnores wrong or is that a bug in vale?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions