Skip to content

Commit eb50174

Browse files
committed
Make Negative more restrictive
1 parent a6e3b7e commit eb50174

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

Microsoft/Negative.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ action:
1010
- "-"
1111
- ""
1212
tokens:
13-
- '-\d+(?:\.\d+)?'
13+
- '(?<=\s)-\d+(?:\.\d+)?\b'

features/rules.feature

+3-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ Feature: Rules
177177
When I test "Numbers"
178178
Then the output should contain exactly:
179179
"""
180-
test.md:1:15:Microsoft.Ranges:In most cases, use 'from' or 'through' to describe a range of numbers.
181-
test.md:4:48:Microsoft.RangeTime:Use 'to' instead of a dash in 'AM - 2:00 PM'.
180+
test.md:3:48:Microsoft.RangeTime:Use 'to' instead of a dash in 'AM - 2:00 PM'.
181+
test.md:7:16:Microsoft.Negative:Form a negative number with an en dash, not a hyphen.
182+
test.md:7:33:Microsoft.Negative:Form a negative number with an en dash, not a hyphen.
182183
"""
183184

184185
Scenario: Date Formatting

fixtures/Numbers/.vale.ini

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ MinAlertLevel = suggestion
66
Microsoft.Ranges = YES
77
Microsoft.RangeFormat = YES
88
Microsoft.RangeTime = YES
9+
Microsoft.Negative = YES

fixtures/Numbers/test.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
Look at pages 3 – 5.
22

3-
43
Use to in a range of times. For example, 10:00 AM - 2:00 PM.
4+
5+
The event was on 2023-04.
6+
7+
The result was -4. I calculated -9.99.

0 commit comments

Comments
 (0)