Skip to content

Commit 624238d

Browse files
committed
Add scoping rules to Vale's configuration
1 parent 4a4526b commit 624238d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.vale.ini

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
StylesPath = ci/vale
22
MinAlertLevel = suggestion
33

4-
[*.{md,html}]
4+
[*.md]
55
BasedOnStyles = CockroachDB
66

77
vale.GenderBias = YES
@@ -10,3 +10,24 @@ vale.Redundancy = YES
1010
vale.Repetition = YES
1111
vale.Uncomparables = YES
1212
CockroachDB.Hyperbolic = NO
13+
14+
# Custom block scoping (see the regex101 links for unit tests):
15+
#
16+
# Rule #1 (https://regex101.com/r/TJQLJ4/2/tests): Ignore `{%comment%}` blocks. This
17+
# keeps Vale from flagging 'endcomment' as a spelling mistake.
18+
#
19+
# Rule #2 (https://regex101.com/r/7VA2lV/2/tests): Ignore `<div>`s and `<section>`s
20+
# that specify `markdown="1"` since it isn't supported by Vale's Markdown
21+
# parser (https://github.com/russross/blackfriday/issues/184).
22+
#
23+
# Rule #3 (https://regex101.com/r/NxFflU/1/tests): Ignore `{% include %}`-codeblock
24+
# pairs.
25+
BlockIgnores = (?s)({%\s?comment\s?%}.+?{%\s?endcomment\s?%}), \
26+
(?s)(<(?:div|section)[^>]*markdown="1"[^>]*>.*?</(?:div|section)>), \
27+
(?s)((?: *{% include [^%]+ %}\n)? *~~~.*?~~~~?)
28+
29+
# Custom inline scoping (see the regex101 links for unit tests):
30+
#
31+
# Rule #1 (https://regex101.com/r/cTiITH/2/tests): Ignore `{% include %}`s, which
32+
# contain file paths.
33+
TokenIgnores = ({%\s?include\s? {{ [^}]+ }}[^%]+\s?%})

0 commit comments

Comments
 (0)