Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: testing: add vale styles #1474

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
StylesPath = vale-styles
MinAlertLevel = suggestion # suggestion, warning or error

[formats]
mdx = md

[*.{md,markdown,txt,htm,html}]
BasedOnStyles = FluentBit
IgnoredScopes = tt, code

FluentBit.Terms = YES
FluentBit.Titles = YES
FluentBit.FutureTense = NO
FluentBit.Headings = NO
FluentBit.Passive = NO
FluentBit.Subjunctive = NO
FluentBit.Colons = NO
10 changes: 10 additions & 0 deletions vale-styles/FluentBit/AMPM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

extends: existence
message: "Use 'AM' or 'PM' (preceded by a space)."
link: 'https://developers.google.com/style/word-list'
level: suggestion
nonword: true
tokens:
- '\d{1,2}[AP]M'
- '\d{1,2} ?[ap]m'
- '\d{1,2} ?[aApP]\.[mM]\.'
95 changes: 95 additions & 0 deletions vale-styles/FluentBit/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
extends: conditional
message: "Spell out '%s', if it's unfamiliar to the audience."
link: 'https://developers.google.com/style/abbreviations'
level: suggestion
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- ACL
- API
- ARN
- ASC
- ASP
- AWS
- CIDR
- CLI
- CPU
- CRD
- CSS
- CSV
- DEBUG
- DESC
- DOM
- DNS
- DPI
- DPPS
- FAQ
- FIPS
- GCC
- GCP
- GDB
- GET
- GNU
- GPG
- GPU
- GTK
- GUI
- GZIP
- HPA
- IAM
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
- LTS
- NET
- NOTE
- NVDA
- OSS
- PATH
- PEM
- PDF
- PHP
- POSIX
- POST
- RAM
- REPL
- REST
- RHEL
- RPC
- RSA
- SASL
- SCM
- SCSS
- SDK
- SIEM
- SLA
- SQL
- SSH
- SSL
- SSO
- SVG
- TBD
- TCP
- TLS
- TRE
- TODO
- UDP
- URI
- URL
- USB
- UTC
- UTF
- UUID
- XML
- XSS
- YAML
- ZIP
8 changes: 8 additions & 0 deletions vale-styles/FluentBit/AmSpelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "In general, use American spelling instead of '%s'."
link: 'https://developers.google.com/style/spelling'
ignorecase: true
level: suggestion
tokens:
- '(?:\w+)nised?'
- '(?:\w+)logue'
9 changes: 9 additions & 0 deletions vale-styles/FluentBit/Ampersand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: existence
message: "Don't use an ampersand in place of the word 'and'. Always write out 'and' unless the ampersand is part of a proper name."
nonword: true
ignorecase: false
level: error
scope: sentence
tokens:
- '[^\*{2}].*.&.*[^\*{2}]\n'
8 changes: 8 additions & 0 deletions vale-styles/FluentBit/Colons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "'%s' should be in lowercase."
link: 'https://developers.google.com/style/colons'
nonword: true
level: suggestion
scope: sentence
tokens:
- ':\s[A-Z]'
30 changes: 30 additions & 0 deletions vale-styles/FluentBit/Contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extends: substitution
message: "Feel free to use '%s' instead of '%s'."
link: 'https://developers.google.com/style/contractions'
level: suggestion
ignorecase: true
action:
name: replace
swap:
are not: aren't
cannot: can't
could not: couldn't
did not: didn't
do not: don't
does not: doesn't
has not: hasn't
have not: haven't
how is: how's
is not: isn't
it is: it's
should not: shouldn't
that is: that's
they are: they're
was not: wasn't
we are: we're
we have: we've
were not: weren't
what is: what's
when is: when's
where is: where's
will not: won't
9 changes: 9 additions & 0 deletions vale-styles/FluentBit/DateFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "Use 'July 31, 2016' format, not '%s'."
link: 'https://developers.google.com/style/dates-times'
ignorecase: true
level: suggestion
nonword: true
tokens:
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
- '\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}'
8 changes: 8 additions & 0 deletions vale-styles/FluentBit/Directional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: existence
message: "Verify your use of '%s' with the Style Guide."
level: suggestion
ignorecase: true
tokens:
- above
- below
18 changes: 18 additions & 0 deletions vale-styles/FluentBit/DontUse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
extends: existence
message: "We don't use '%s'."
ignorecase: true
level: suggestion
tokens:
- a.k.a.
- aka
- and/or
- at this point
- desire
- it is recommended that
- just
- note that
- please
- quite
- such that
- thus
8 changes: 8 additions & 0 deletions vale-styles/FluentBit/Drilldown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: sequence
message: "Use drilldown as an adjective or noun."
level: suggestion
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:drill down|drill-down)'
8 changes: 8 additions & 0 deletions vale-styles/FluentBit/DrilldownVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: sequence
message: "Use drill down as a verb."
level: suggestion
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:drilldown|drill-down)'
9 changes: 9 additions & 0 deletions vale-styles/FluentBit/Ellipses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "In general, don't use an ellipsis."
link: 'https://developers.google.com/style/ellipses'
nonword: true
level: suggestion
action:
name: remove
tokens:
- '\.\.\.'
12 changes: 12 additions & 0 deletions vale-styles/FluentBit/EmDash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "Don't put a space before or after a dash."
link: 'https://developers.google.com/style/dashes'
nonword: true
level: suggestion
action:
name: edit
params:
- remove
- ' '
tokens:
- '\s[—–]\s'
13 changes: 13 additions & 0 deletions vale-styles/FluentBit/EnDash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Use an em dash ('—') instead of '–'."
link: 'https://developers.google.com/style/dashes'
nonword: true
level: suggestion
action:
name: edit
params:
- replace
- '-'
- '—'
tokens:
- '–'
7 changes: 7 additions & 0 deletions vale-styles/FluentBit/Exclamation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Don't use exclamation points in text."
link: 'https://developers.google.com/style/exclamation-points'
nonword: true
level: suggestion
tokens:
- '\w!(?:\s|$)'
13 changes: 13 additions & 0 deletions vale-styles/FluentBit/FirstPerson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Avoid first-person pronouns such as '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
ignorecase: true
level: suggestion
nonword: true
tokens:
- (?:^|\s)I\s
- (?:^|\s)I,\s
- \bI'm\b
- \bme\b
- \bmy\b
- \bmine\b
10 changes: 10 additions & 0 deletions vale-styles/FluentBit/FutureTense.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
extends: existence
message: "'%s' might be in future tense. Strive for active voice and present tense in your documentation."
ignorecase: true
level: suggestion
raw:
- "(going to( |\n|[[:punct:]])[a-zA-Z]*|"
- "will( |\n|[[:punct:]])[a-zA-Z]*|"
- "won't( |\n|[[:punct:]])[a-zA-Z]*|"
- "[a-zA-Z]*'ll( |\n|[[:punct:]])[a-zA-Z]*)"
9 changes: 9 additions & 0 deletions vale-styles/FluentBit/Gender.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "Don't use '%s' as a gender-neutral pronoun."
link: 'https://developers.google.com/style/pronouns#gender-neutral-pronouns'
level: suggestion
ignorecase: true
tokens:
- he/she
- s/he
- \(s\)he
45 changes: 45 additions & 0 deletions vale-styles/FluentBit/GenderBias.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
extends: substitution
message: "Consider using '%s' instead of '%s'."
link: 'https://developers.google.com/style/inclusive-documentation'
ignorecase: true
level: suggestion
swap:
(?:alumna|alumnus): graduate
(?:alumnae|alumni): graduates
air(?:m[ae]n|wom[ae]n): pilot(s)
anchor(?:m[ae]n|wom[ae]n): anchor(s)
authoress: author
camera(?:m[ae]n|wom[ae]n): camera operator(s)
chair(?:m[ae]n|wom[ae]n): chair(s)
congress(?:m[ae]n|wom[ae]n): member(s) of congress
door(?:m[ae]|wom[ae]n): concierge(s)
draft(?:m[ae]n|wom[ae]n): drafter(s)
fire(?:m[ae]n|wom[ae]n): firefighter(s)
fisher(?:m[ae]n|wom[ae]n): fisher(s)
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
lady lawyer: lawyer
ladylike: courteous
landlord: building manager
mail(?:m[ae]n|wom[ae]n): mail carriers
man and wife: husband and wife
man enough: strong enough
mankind: human kind
manmade: manufactured
manpower: personnel
men and girls: men and women
middle(?:m[ae]n|wom[ae]n): intermediary
news(?:m[ae]n|wom[ae]n): journalist(s)
ombuds(?:man|woman): ombuds
oneupmanship: upstaging
poetess: poet
police(?:m[ae]n|wom[ae]n): police officer(s)
repair(?:m[ae]n|wom[ae]n): technician(s)
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
service(?:m[ae]n|wom[ae]n): soldier(s)
steward(?:ess)?: flight attendant
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
waitress: waiter
woman doctor: doctor
woman scientist[s]?: scientist(s)
work(?:m[ae]n|wom[ae]n): worker(s)
13 changes: 13 additions & 0 deletions vale-styles/FluentBit/HeadingPunctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Don't put a period at the end of a heading."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
nonword: true
level: suggestion
scope: heading
action:
name: edit
params:
- remove
- '.'
tokens:
- '[a-z0-9][.]\s*$'
Loading