Skip to content

Commit e512809

Browse files
authored
feat: align Vale rules with updated style guide (#38)
Update existing rules and add new rules to match the latest DigitalOcean style guide changes from product-docs. Updated rules: - ConsiderateWriting: add violent metaphors and idioms - GenderBias: add hyphenated variants - DigitalOceanTerms: add AI product terminology New rules: - EmDashes: flag en/em dashes - ExclamationMarks: warn about exclamation marks - RangeSpacing: flag spaces in ranges - ModalAuxiliaries: warn about modal verbs - VagueLinkText: flag vague link text - WordChoicePhrasalVerbs: enforce phrasal verb usage - Ellipses: warn about inappropriate ellipses - LeadingZero: require leading zero in decimals Total rules: 29 (was 21)
1 parent cbd04cb commit e512809

File tree

11 files changed

+104
-2
lines changed

11 files changed

+104
-2
lines changed

styles/DigitalOcean/ConsiderateWriting.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ swap:
1212
insanely: incredibly
1313
dummy: placeholder|stand-in|test
1414
stupid: foolish|ludicrous|unintelligent
15-
(?:fall|fell|falling) on deaf ears: missed the mark|was ignored
15+
(?:fall|fell|falling) on deaf ears: missed the mark|was ignored|were ignored
1616
blind spot: weakness|something we overlooked
17-
sanity check: check
17+
sanity check: check|verify|review
18+
kill (?:a|the) (?:process|task|job): terminate|stop
19+
killed (?:a|the) (?:process|task|job): terminated|stopped
20+
killing (?:a|the) (?:process|task|job): terminating|stopping
21+
shoot (?:an|the|a) (?:email|message): send|forward|submit
22+
shot (?:an|the|a) (?:email|message): sent|forwarded|submitted
23+
shooting (?:an|the|a) (?:email|message): sending|forwarding|submitting
24+
tribal knowledge: existing knowledge|internal documentation
25+
low-hanging fruit: early opportunity|simple task
26+
white knight: system recovery

styles/DigitalOcean/DigitalOceanTerms.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ swap:
2121
'Digitalocean': DigitalOcean
2222
'digitalocean^(?:.com)': DigitalOcean
2323
droplet[s]?: Droplet(s)
24+
\bspace[s]?(?! bucket| for| between| after| before| around| in): Space(s)
25+
the Gradient AI Platform: Gradient AI Platform
26+
model [Pp]layground: Model Playground
27+
agent [Pp]layground: Agent Playground

styles/DigitalOcean/Ellipses.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Use ellipses only to represent truncated output or omitted quoted text, not for tone or style: '%s'."
3+
link: https://docs.digitalocean.com/style/digitalocean/grammar/punctuation
4+
level: warning
5+
scope: sentence
6+
nonword: true
7+
# This rule flags ellipses in narrative text (not code blocks)
8+
# It will produce some false positives in legitimate technical uses
9+
# Use Vale comments to ignore specific instances if needed
10+
tokens:
11+
- '\.\.\.'
12+
- '' # Unicode ellipsis character

styles/DigitalOcean/EmDashes.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "Do not use en dashes (–) or em dashes (—). Use hyphens (-) for ranges and compound modifiers."
3+
link: https://docs.digitalocean.com/style/digitalocean/grammar/punctuation
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '' # en dash (U+2013)
8+
- '' # em dash (U+2014)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "Avoid exclamation marks in technical documentation. Rewrite for clarity instead of relying on punctuation for emphasis."
3+
link: https://docs.digitalocean.com/style/digitalocean/grammar/punctuation
4+
level: warning
5+
nonword: true
6+
scope: sentence
7+
tokens:
8+
- '!'

styles/DigitalOcean/GenderBias.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ swap:
2121
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
2222
work(?:m[ae]n|wom[ae]n): worker(s)
2323
manhours: workhours
24+
man-hours: work-hours
2425
manpower: staff
26+
work(?:m[ae]n|wom[ae]n): worker(s)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Include a leading zero for decimals less than one: '%s'."
3+
link: https://docs.digitalocean.com/style/digitalocean/grammar/numbers
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '(?:^|\s)\.(\d+)' # Decimal without leading zero like " .5"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extends: existence
2+
message: "Avoid modal auxiliaries like '%s', which can confuse non-native speakers. Use direct, present-tense verbs instead."
3+
link: https://docs.digitalocean.com/style/digitalocean/language/verbs
4+
level: warning
5+
ignorecase: true
6+
tokens:
7+
- '\bshould\b'
8+
- '\bcould\b'
9+
- '\bmay\b'
10+
- '\bmight\b'
11+
- '\bshould not\b'
12+
- '\bcould not\b'
13+
- '\bmay not\b'
14+
- '\bmight not\b'
15+
- '\bshouldn''t\b'
16+
- '\bcouldn''t\b'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Do not add spaces around hyphens in ranges: '%s'."
3+
link: https://docs.digitalocean.com/style/digitalocean/grammar/hyphens
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '\d+\s+-\s+\d+' # numeric ranges like "10 - 20"
8+
- '\d+\s+-\d+' # "10 -20"
9+
- '\d+-\s+\d+' # "10- 20"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extends: existence
2+
message: "Use descriptive link text. Avoid vague phrases like '%s'."
3+
link: https://docs.digitalocean.com/style/digitalocean/language/links-and-link-text
4+
level: error
5+
ignorecase: true
6+
tokens:
7+
- 'click here'
8+
- 'learn more'
9+
- 'read more'
10+
- 'more info'
11+
- 'more information'
12+
- 'this page'
13+
- 'this link'
14+
- 'here'
15+
- 'click this link'
16+
- 'follow this link'

0 commit comments

Comments
 (0)