Skip to content

Commit 3eb8593

Browse files
Add vale gh action and rules (#775)
1 parent 9cd60b1 commit 3eb8593

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1848
-0
lines changed
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
extends: conditional
2+
message: "Spell out '%s', unless it is a common abbreviation is common it is not
3+
the first use in this article or topic."
4+
link: 'https://docs.mongodb.com/meta/style-guide/style/abbreviations/'
5+
level: suggestion
6+
ignorecase: false
7+
# Ensures that the existence of 'first' implies the existence of 'second'.
8+
first: '\b([A-Z]{3,5})\b'
9+
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
10+
exceptions:
11+
- API
12+
- ASCII
13+
- BIOS
14+
- BSON
15+
- CD
16+
- CD-ROM
17+
- CGI
18+
- CLI
19+
- CPU
20+
- CSS
21+
- CSV
22+
- DNS
23+
- DVD
24+
- FAQ
25+
- FTP
26+
- GB
27+
- GHz
28+
- GMT
29+
- GNU
30+
- GUI
31+
- GUID
32+
- HTML
33+
- HTTP
34+
- HTTPS
35+
- ID
36+
- IEEE
37+
- IMAP
38+
- I/O
39+
- IP
40+
- JSON
41+
- KB
42+
- Kbps
43+
- KBps
44+
- kHz
45+
- KMS
46+
- LAN
47+
- LDAP
48+
- MB
49+
- MHz
50+
- NIC
51+
- NTFS
52+
- OLE
53+
- OS
54+
- PEM
55+
- PDF
56+
- PHP
57+
- POP
58+
- PROD
59+
- PSA
60+
- RAM
61+
- REST
62+
- ROM
63+
- SaaS
64+
- SGML
65+
- SMTP
66+
- SQL
67+
- SSD
68+
- SSH
69+
- SSL
70+
- TCP
71+
- TCP/IP
72+
- TLS
73+
- TTL
74+
- URI
75+
- URL
76+
- USB
77+
- USD
78+
- UTC
79+
- VLAN
80+
- WAN
81+
- XFS
82+
- XML
83+
- YAML
84+
- ZIP
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Based on: https://github.com/errata-ai/Google/blob/master/Google/Periods.yml
2+
extends: existence
3+
message: "Don't use periods with acronyms or initialisms such as '%s'."
4+
link: 'https://docs.mongodb.com/meta/style-guide/style/abbreviations/'
5+
level: suggestion
6+
nonword: true
7+
tokens:
8+
- '\b(?:[A-Z]\.){3,}'
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Based on: https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Accessibility.yml
2+
3+
extends: existence
4+
message: "Don't use language (such as '%s') that defines people by their disability."
5+
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms
6+
level: error
7+
ignorecase: true
8+
tokens:
9+
- a victim of
10+
- able-bodied
11+
- affected by
12+
- an epileptic
13+
- crippled
14+
- disabled
15+
- dumb
16+
- handicapped
17+
- handicaps
18+
- healthy
19+
- lame
20+
- maimed
21+
- missing a limb
22+
- mute
23+
- normal
24+
- sight-impaired
25+
- stricken with
26+
- suffers from
27+
- vision-impaired

.github/styles/MongoDB/Adverbs.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "You can remove most adverbs. Use your best judgment."
3+
link: 'https://docs.mongodb.com/meta/style-guide/writing/write-clear-concise-sentences-paragraphs/#use-the-necessary-words'
4+
level: suggestion
5+
ignorecase: true
6+
scope: sentence
7+
nonword: false
8+
tokens:
9+
- '\b(\w+ly)'
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Avoid using the antecedent '%s' at the beginning of sentences or clauses."
3+
link: 'https://docs.mongodb.com/meta/style-guide/writing/use-pronouns-carefully/'
4+
level: suggestion
5+
ignorecase: false
6+
scope: sentence
7+
nonword: true
8+
tokens:
9+
- '(\sIt is)'
10+
- '(\sThis)'
11+
- '(\sThere (is|are))'
12+
- '(\sThat)'

.github/styles/MongoDB/Avoid.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extends: existence
2+
message: "Don't use '%s'."
3+
link: 'https://docs.mongodb.com/meta/style-guide/terminology/alphabetical-terms/'
4+
ignorecase: true
5+
level: error
6+
tokens:
7+
- abortion
8+
- and/or
9+
- and so on
10+
- slash mark
11+
- billion
12+
- biweekly
13+
- bimonthly
14+
- front end
15+
- front-end
16+
- if necessary
17+
- respectively
18+
- trillion
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "Use accessible only to refer to things that all people, including those with disabilities, can easily use. Don’t use it to mean simple or open."
3+
link: 'https://docs.mongodb.com/meta/style-guide/terminology/alphabetical-terms/'
4+
level: error
5+
ignorecase: false
6+
nonword: false
7+
tokens:
8+
- accessible
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Based on https://github.com/errata-ai/Google/blob/master/Google/We.yml
2+
3+
extends: existence
4+
message: "Avoid first-person pronouns such as '%s' where possible."
5+
link: 'https://docs.mongodb.com/meta/style-guide/writing/write-to-the-user/#write-to-the-user'
6+
ignorecase: true
7+
level: suggestion
8+
nonword: true
9+
tokens:
10+
- (?:^|\s)I\s
11+
- (?:^|\s)I,\s
12+
- \bI'm\b
13+
- \bI've\b
14+
- \bme\b
15+
- \bmy\b
16+
- \bmine\b
17+
- (?:^|\s)We\s
18+
- (?:^|\s)We,\s
19+
- \bWe're\b
20+
- \bWe've\b
21+
- \bus\b
22+
- \bours?\b
23+
- let's
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Based on: https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab
2+
extends: existence
3+
message: 'Avoid using future tense where possible.'
4+
ignorecase: true
5+
level: warning
6+
link: 'https://docs.mongodb.com/meta/style-guide/writing/use-present-tense/'
7+
raw:
8+
- "(going to( |\n|[[:punct:]])[a-zA-Z]*|"
9+
- "will( |\n|[[:punct:]])[a-zA-Z]*|"
10+
- "won't( |\n|[[:punct:]])[a-zA-Z]*|"
11+
- "[a-zA-Z]*'ll( |\n|[[:punct:]])[a-zA-Z]*)"
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
link: 'https://docs.mongodb.com/meta/style-guide/terminology/general-term-guidelines/avoid-obscure-words/'
4+
level: error
5+
ignorecase: true
6+
action:
7+
name: replace
8+
swap:
9+
'(?:eg|e\.g\.)[\s,]': for example, such as
10+
etc: and so on
11+
'(?:ie|i\.e\.)[\s,]': that is
12+
as per: according to, by way of
13+
via: through, by
14+
'(?:vs\.)[\s,]': versus
15+
ergo: therefore

0 commit comments

Comments
 (0)