Skip to content

Commit d902191

Browse files
committed
Add word boundaries to Units.yml
This ensures that our units (such as 'cm') aren't part of another word. Fixes #19.
1 parent 36c7277 commit d902191

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Microsoft/Units.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
extends: existence
22
message: "Don't spell out the number in '%s'."
33
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/units-of-measure-terms
4-
nonword: true
54
level: error
65
raw:
7-
- '\b[a-zA-Z]+\s'
6+
- '[a-zA-Z]+\s'
87
tokens:
98
- '(?:centi|milli)?meters'
109
- '(?:kilo)?grams'

features/rules.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Feature: Rules
8686
"""
8787
test.md:5:17:Microsoft.Units:Don't spell out the number in 'five pounds'.
8888
test.md:7:8:Microsoft.Units:Don't spell out the number in 'six meters'.
89+
test.md:11:8:Microsoft.Units:Don't spell out the number in 'ten cm'.
8990
"""
9091

9192
Scenario: URL grammar

fixtures/Units/test.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ Cook on high for three minutes.
55
The box weighed five pounds.
66

77
It was six meters long.
8+
9+
Using a task is similar to using a cmdlet or a function call.
10+
11+
A wire ten cm long is cut into 2 pieces, one of length x and the other of length 10-x. Each piece is bent into the shape of a square.

0 commit comments

Comments
 (0)