Skip to content

Commit ca24a8a

Browse files
committed
Add Vale setup for writing style checks
- Add instructions for usage - Add minimal word list
1 parent fe5573f commit ca24a8a

37 files changed

+761
-0
lines changed

docs/.vale.ini

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
StylesPath = .vale
2+
3+
MinAlertLevel = warning ## error, warning, or suggestion
4+
Vocab = Base
5+
6+
Packages = Google
7+
8+
[*.{md,rst}]
9+
BasedOnStyles = Vale, Google
10+
11+
Google.Passive = NO

docs/.vale/Google/AMPM.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Use 'AM' or 'PM' (preceded by a space)."
3+
link: 'https://developers.google.com/style/word-list'
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '\d{1,2}[AP]M'
8+
- '\d{1,2} ?[ap]m'
9+
- '\d{1,2} ?[aApP]\.[mM]\.'

docs/.vale/Google/Acronyms.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
extends: conditional
2+
message: "Spell out '%s', if it's unfamiliar to the audience."
3+
link: 'https://developers.google.com/style/abbreviations'
4+
level: suggestion
5+
ignorecase: false
6+
# Ensures that the existence of 'first' implies the existence of 'second'.
7+
first: '\b([A-Z]{3,5})\b'
8+
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
9+
# ... with the exception of these:
10+
exceptions:
11+
- API
12+
- ASP
13+
- CLI
14+
- CPU
15+
- CSS
16+
- CSV
17+
- DEBUG
18+
- DOM
19+
- DPI
20+
- FAQ
21+
- GCC
22+
- GDB
23+
- GET
24+
- GPU
25+
- GTK
26+
- GUI
27+
- HTML
28+
- HTTP
29+
- HTTPS
30+
- IDE
31+
- JAR
32+
- JSON
33+
- JSX
34+
- LESS
35+
- LLDB
36+
- NET
37+
- NOTE
38+
- NVDA
39+
- OSS
40+
- PATH
41+
- PDF
42+
- PHP
43+
- POST
44+
- RAM
45+
- REPL
46+
- RSA
47+
- SCM
48+
- SCSS
49+
- SDK
50+
- SQL
51+
- SSH
52+
- SSL
53+
- SVG
54+
- TBD
55+
- TCP
56+
- TODO
57+
- URI
58+
- URL
59+
- USB
60+
- UTF
61+
- XML
62+
- XSS
63+
- YAML
64+
- ZIP

docs/.vale/Google/Colons.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "'%s' should be in lowercase."
3+
link: 'https://developers.google.com/style/colons'
4+
nonword: true
5+
level: warning
6+
scope: sentence
7+
tokens:
8+
- ':\s[A-Z]'

docs/.vale/Google/Contractions.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
extends: substitution
2+
message: "Feel free to use '%s' instead of '%s'."
3+
link: 'https://developers.google.com/style/contractions'
4+
level: suggestion
5+
ignorecase: true
6+
action:
7+
name: replace
8+
swap:
9+
are not: aren't
10+
cannot: can't
11+
could not: couldn't
12+
did not: didn't
13+
do not: don't
14+
does not: doesn't
15+
has not: hasn't
16+
have not: haven't
17+
how is: how's
18+
is not: isn't
19+
it is: it's
20+
should not: shouldn't
21+
that is: that's
22+
they are: they're
23+
was not: wasn't
24+
we are: we're
25+
we have: we've
26+
were not: weren't
27+
what is: what's
28+
when is: when's
29+
where is: where's
30+
will not: won't

docs/.vale/Google/DateFormat.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Use 'July 31, 2016' format, not '%s'."
3+
link: 'https://developers.google.com/style/dates-times'
4+
ignorecase: true
5+
level: error
6+
nonword: true
7+
tokens:
8+
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
9+
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}'

docs/.vale/Google/Ellipses.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "In general, don't use an ellipsis."
3+
link: 'https://developers.google.com/style/ellipses'
4+
nonword: true
5+
level: warning
6+
action:
7+
name: remove
8+
tokens:
9+
- '\.\.\.'

docs/.vale/Google/EmDash.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Don't put a space before or after a dash."
3+
link: 'https://developers.google.com/style/dashes'
4+
nonword: true
5+
level: error
6+
action:
7+
name: edit
8+
params:
9+
- remove
10+
- ' '
11+
tokens:
12+
- '\s[—–]\s'

docs/.vale/Google/EnDash.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Use an em dash ('—') instead of '–'."
3+
link: 'https://developers.google.com/style/dashes'
4+
nonword: true
5+
level: error
6+
action:
7+
name: edit
8+
params:
9+
- replace
10+
- '-'
11+
- ''
12+
tokens:
13+
- ''

docs/.vale/Google/Exclamation.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Don't use exclamation points in text."
3+
link: 'https://developers.google.com/style/exclamation-points'
4+
nonword: true
5+
level: error
6+
tokens:
7+
- '\w!(?:\s|$)'

docs/.vale/Google/FirstPerson.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Avoid first-person pronouns such as '%s'."
3+
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
4+
ignorecase: true
5+
level: warning
6+
nonword: true
7+
tokens:
8+
- (?:^|\s)I\s
9+
- (?:^|\s)I,\s
10+
- \bI'm\b
11+
- \bme\b
12+
- \bmy\b
13+
- \bmine\b

docs/.vale/Google/Gender.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Don't use '%s' as a gender-neutral pronoun."
3+
link: 'https://developers.google.com/style/pronouns#gender-neutral-pronouns'
4+
level: error
5+
ignorecase: true
6+
tokens:
7+
- he/she
8+
- s/he
9+
- \(s\)he

docs/.vale/Google/GenderBias.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
extends: substitution
2+
message: "Consider using '%s' instead of '%s'."
3+
link: 'https://developers.google.com/style/inclusive-documentation'
4+
ignorecase: true
5+
level: error
6+
swap:
7+
(?:alumna|alumnus): graduate
8+
(?:alumnae|alumni): graduates
9+
air(?:m[ae]n|wom[ae]n): pilot(s)
10+
anchor(?:m[ae]n|wom[ae]n): anchor(s)
11+
authoress: author
12+
camera(?:m[ae]n|wom[ae]n): camera operator(s)
13+
chair(?:m[ae]n|wom[ae]n): chair(s)
14+
congress(?:m[ae]n|wom[ae]n): member(s) of congress
15+
door(?:m[ae]|wom[ae]n): concierge(s)
16+
draft(?:m[ae]n|wom[ae]n): drafter(s)
17+
fire(?:m[ae]n|wom[ae]n): firefighter(s)
18+
fisher(?:m[ae]n|wom[ae]n): fisher(s)
19+
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
20+
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
21+
lady lawyer: lawyer
22+
ladylike: courteous
23+
landlord: building manager
24+
mail(?:m[ae]n|wom[ae]n): mail carriers
25+
man and wife: husband and wife
26+
man enough: strong enough
27+
mankind: human kind
28+
manmade: manufactured
29+
manpower: personnel
30+
men and girls: men and women
31+
middle(?:m[ae]n|wom[ae]n): intermediary
32+
news(?:m[ae]n|wom[ae]n): journalist(s)
33+
ombuds(?:man|woman): ombuds
34+
oneupmanship: upstaging
35+
poetess: poet
36+
police(?:m[ae]n|wom[ae]n): police officer(s)
37+
repair(?:m[ae]n|wom[ae]n): technician(s)
38+
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
39+
service(?:m[ae]n|wom[ae]n): soldier(s)
40+
steward(?:ess)?: flight attendant
41+
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
42+
waitress: waiter
43+
woman doctor: doctor
44+
woman scientist[s]?: scientist(s)
45+
work(?:m[ae]n|wom[ae]n): worker(s)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Don't put a period at the end of a heading."
3+
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
4+
nonword: true
5+
level: warning
6+
scope: heading
7+
action:
8+
name: edit
9+
params:
10+
- remove
11+
- '.'
12+
tokens:
13+
- '[a-z0-9][.]\s*$'

docs/.vale/Google/Headings.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
extends: capitalization
2+
message: "'%s' should use sentence-style capitalization."
3+
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
4+
level: warning
5+
scope: heading
6+
match: $sentence
7+
indicators:
8+
- ':'
9+
exceptions:
10+
- Azure
11+
- CLI
12+
- Code
13+
- Cosmos
14+
- Docker
15+
- Emmet
16+
- gRPC
17+
- I
18+
- Kubernetes
19+
- Linux
20+
- macOS
21+
- Marketplace
22+
- MongoDB
23+
- REPL
24+
- Studio
25+
- TypeScript
26+
- URLs
27+
- Visual
28+
- VS
29+
- Windows

docs/.vale/Google/Latin.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
link: 'https://developers.google.com/style/abbreviations'
4+
ignorecase: true
5+
level: error
6+
nonword: true
7+
action:
8+
name: replace
9+
swap:
10+
'\b(?:eg|e\.g\.)[\s,]': for example
11+
'\b(?:ie|i\.e\.)[\s,]': that is

docs/.vale/Google/LyHyphens.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: existence
2+
message: "'%s' doesn't need a hyphen."
3+
link: 'https://developers.google.com/style/hyphens'
4+
level: error
5+
ignorecase: false
6+
nonword: true
7+
action:
8+
name: edit
9+
params:
10+
- replace
11+
- '-'
12+
- ' '
13+
tokens:
14+
- '\s[^\s-]+ly-'

docs/.vale/Google/OptionalPlurals.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Don't use plurals in parentheses such as in '%s'."
3+
link: 'https://developers.google.com/style/plurals-parentheses'
4+
level: error
5+
nonword: true
6+
action:
7+
name: edit
8+
params:
9+
- remove
10+
- '(s)'
11+
tokens:
12+
- '\b\w+\(s\)'

docs/.vale/Google/Ordinal.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Spell out all ordinal numbers ('%s') in text."
3+
link: 'https://developers.google.com/style/numbers'
4+
level: error
5+
nonword: true
6+
tokens:
7+
- \d+(?:st|nd|rd|th)

docs/.vale/Google/OxfordComma.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Use the Oxford comma in '%s'."
3+
link: 'https://developers.google.com/style/commas'
4+
scope: sentence
5+
level: warning
6+
tokens:
7+
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'

docs/.vale/Google/Parens.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Use parentheses judiciously."
3+
link: 'https://developers.google.com/style/parentheses'
4+
nonword: true
5+
level: suggestion
6+
tokens:
7+
- '\(.+\)'

0 commit comments

Comments
 (0)