Skip to content

Commit 04d20b0

Browse files
committed
add modified Google styles
1 parent 15b2c9f commit 04d20b0

25 files changed

+511
-0
lines changed

.vale/styles/Google/AMPM.yml

Lines changed: 9 additions & 0 deletions
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\b'
8+
- '\d{1,2} ?[ap]m\b'
9+
- '\d{1,2} ?[aApP]\.[mM]\.'

.vale/styles/Google/Acronyms.yml

Lines changed: 64 additions & 0 deletions
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

.vale/styles/Google/DateFormat.yml

Lines changed: 9 additions & 0 deletions
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}'

.vale/styles/Google/Ellipses.yml

Lines changed: 9 additions & 0 deletions
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+
- '\.\.\.'

.vale/styles/Google/EmDash.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Don't put a space before or after an em dash."
3+
link: "https://developers.google.com/style/dashes"
4+
nonword: true
5+
level: error
6+
action:
7+
name: edit
8+
params:
9+
- trim
10+
- " "
11+
tokens:
12+
- '\s[—–]\s'
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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: warning
6+
action:
7+
name: edit
8+
params:
9+
- trim_right
10+
- "!"
11+
tokens:
12+
- '\w+!(?:\s|$)'
Lines changed: 13 additions & 0 deletions
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
Lines changed: 13 additions & 0 deletions
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+
- trim_right
11+
- "."
12+
tokens:
13+
- '[a-z0-9][.]\s*$'

.vale/styles/Google/Headings.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
- CLI
11+
- GitHub
12+
- GitLab
13+
- Linux
14+
- macOS
15+
- Mintlify
16+
- TypeScript
17+
- URLs
18+
- Windows
19+
- JSON

.vale/styles/Google/Latin.yml

Lines changed: 11 additions & 0 deletions
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

0 commit comments

Comments
 (0)