Skip to content

Add vale prose linter #1646

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

Merged
merged 43 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b78b8be
add .vale.ini+basic rules
maryamsulemani97 May 19, 2022
914b38d
remove wordiness rule
maryamsulemani97 May 19, 2022
000e03e
add comments explaining each rule+add links to further explanation
maryamsulemani97 May 23, 2022
e7ede4c
update headings rule(not working)
maryamsulemani97 May 23, 2022
68b97a7
remove heading rules
maryamsulemani97 May 24, 2022
6949513
ignore first person rule for telemetry.md
maryamsulemani97 May 24, 2022
63422d1
add rule for repeated words
maryamsulemani97 May 24, 2022
bb11701
update list of accepted words
maryamsulemani97 May 26, 2022
04c8b4c
updated list of accepted words_2
maryamsulemani97 May 26, 2022
2575a3c
update list of files to ignore `FirstPerson.yml`
maryamsulemani97 May 26, 2022
796daf3
update `accept.txt` to ignore any text in []
maryamsulemani97 May 26, 2022
52199c1
more accepted words
maryamsulemani97 May 26, 2022
2d7e0d8
update `Condescending.yml`
maryamsulemani97 May 26, 2022
5f13e36
sound condescending for now
maryamsulemani97 Jun 6, 2022
c7da541
Update styles/Vocab/word_list/accept.txt
maryamsulemani97 Jun 7, 2022
17a4ab0
Update styles/Vocab/word_list/accept.txt
maryamsulemani97 Jun 7, 2022
d04a80d
Update styles/Vocab/word_list/accept.txt
maryamsulemani97 Jun 7, 2022
63a2ea0
Update styles/Vocab/word_list/accept.txt
maryamsulemani97 Jun 7, 2022
0f065d8
Update styles/style_guide/Periods.yml
maryamsulemani97 Jun 7, 2022
a1e4d23
Update styles/style_guide/URLFormat.yml
maryamsulemani97 Jun 7, 2022
555b2ce
Update accept.txt
maryamsulemani97 Jun 7, 2022
bb354f7
update based on review
maryamsulemani97 Jun 7, 2022
0e8bd28
update heading rules
maryamsulemani97 Jun 7, 2022
d14cfd1
move rules to `.vale` folder
maryamsulemani97 Jun 7, 2022
a817ff1
Update accept.txt
maryamsulemani97 Jun 7, 2022
587779f
Update vale.ini to add MinAlertLevel
maryamsulemani97 Jun 8, 2022
8ddceb8
Update accept.txt
maryamsulemani97 Jun 8, 2022
6c7b776
Update .vale/styles/style_guide/HeadingPunctuation.yml
maryamsulemani97 Jun 8, 2022
26821b3
Update .vale/styles/style_guide/Headings.yml
maryamsulemani97 Jun 8, 2022
2b59645
Update FirstPerson.yml
maryamsulemani97 Jun 8, 2022
0ae23f2
Update HeadingPunctuation.yml
maryamsulemani97 Jun 8, 2022
b41877b
Update Headings.yml
maryamsulemani97 Jun 8, 2022
4dd95da
Update accept.txt
maryamsulemani97 Jun 8, 2022
183cb7f
update vale.ini
maryamsulemani97 Jun 9, 2022
8cbf38f
Update Spacing.yml
maryamsulemani97 Jun 9, 2022
b100792
Update and rename spellcheck.yml to Spelling.yml
maryamsulemani97 Jun 9, 2022
ec628f9
add warning/error name + added internal link & merge conflict rules
maryamsulemani97 Jun 9, 2022
6dd5d28
update based on review
maryamsulemani97 Jun 13, 2022
d8334ab
Update accept.txt
maryamsulemani97 Jun 13, 2022
05312a1
Update .vale/styles/Vocab/word_list/accept.txt
maryamsulemani97 Jun 13, 2022
89db44b
update based on review
maryamsulemani97 Jun 13, 2022
6ff5495
Update accept.txt
maryamsulemani97 Jun 13, 2022
810b7fa
Update .vale/styles/style_guide/Repetition.yml
maryamsulemani97 Jun 13, 2022
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
10 changes: 10 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
StylesPath = .vale/styles
MinAlertLevel = suggestion

Vocab = word_list

[*.md]
BasedOnStyles = style_guide

#style_guide.Headings = NO
#style_guide.HeadingPunctuation = NO
67 changes: 67 additions & 0 deletions .vale/styles/Vocab/word_list/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Meilisearch
[Ss]ubroute
[Ss]ubstring
uid
jq
Qovery
Koyeb
Vue
[Gg]eosearch
Nginx
Docxtemplater
[Cc]onfig
Algolia
Typesense
Symfony
Laravel
Strapi
[Ss]chemaless
[Rr]eindexed
chatbox
Lucene
Levenshtein
Swiftype
[Tt]okenizer
[Tt]okenization
[Aa]sync
[Ee]nqueued
[Ff]ilepath
[Ww]ebshop
boolean
Taj
Mahal
[Cc]ertbot
[Tt]oolchain
Jieba
Lindera
Netlify
[Oo]verconsumption
[Gg]eopositioning
hanzi
[Aa]utobatching
[Ii]mpactful
[Ll]owercased
[Mm]ultitenancy
[Rr]ulesets
[Pp]repended
[Aa]nonymized
[Ss]erverless
[Aa]utoscaling
[Hh]ostname
Scaleway
cron
mkcert
[Uu]pvote
Docsearch
[Oo]rderable
[Pp]erformant
Nutch
[Ss]ubproject
Doofinder
'/\(\B(.*?)\)'
[Ss]harding
[Mm]eili
jsonlines
Biutiful
Gb
docs-searchbar.js
Empty file.
17 changes: 17 additions & 0 deletions .vale/styles/style_guide/FirstPerson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Suggestion: style_guide.FirstPerson

# We want to avoid using singular first person pronouns
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
12 changes: 12 additions & 0 deletions .vale/styles/style_guide/HeadingPunctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Suggestion: style_guide.HeadingPunctuation.yml

# Need to update this for "1. Click this" "1.1. Click that"
# Our headings should not use end punctuation
extends: existence
message: "Don't use end punctuation in headings."
link: https://developers.google.com/style/periods
level: suggestion
scope: heading
tokens:
- '[a-z0-9][.?!](?:\s|$)'
51 changes: 51 additions & 0 deletions .vale/styles/style_guide/Headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# Suggestion: style_guide.Headings.yml

# Our headings should use sentence-style capitalization. The exceptions include any headings that maybe a list, start with "Step 1: Do this", and the list of words below
extends: capitalization
message: "'%s' should use sentence-style capitalization."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
level: suggestion
scope: heading
match: $sentence
indicators:
- ':'
exceptions:
- Azure
- CLI
- Code
- Docker
- SDK
- SDKs
- Kubernetes
- Linux
- macOS
- Marketplace
- MongoDB
- TypeScript
- URLs
- Visual
- VS
- Windows
- Meilisearch
- AWS
- Amazon Web Services
- DigitalOcean
- GCP
- Qovery
- GCP
- Google Cloud Platform
- Compute Engine
- GitHub
- JSON
- API
- VuePress
- OpenAPI
- Elasticsearch
- Algolia
- DevOps
- Lucene-Solr
- App Service Auto-Scale
- Certbot
- Bleve & Tantivy
- '([0-9a-z]:\s[A-Z])' #How do get this to throw an error for `Step 1: do this`?
11 changes: 11 additions & 0 deletions .vale/styles/style_guide/Meilisearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Error: style_guide.Meilisearch.yml

# Lists any possible typos for Meilisearch
extends: substitution
message: "Use '%s' instead of '%s'."
level: error
swap:
MeiliSearch: Meilisearch
MieliSearch: Meilisearch
meiliSearch: Meilisearch
12 changes: 12 additions & 0 deletions .vale/styles/style_guide/MergeConflictMarkers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Error: style_guide.MergeConflictMarkers.yml

# Checks for the presence of merge conflict markers.
extends: existence
message: 'Merge conflict marker "%s" found.'
link: https://docs.gitlab.com/ee/development/code_review.html#merging-a-merge-request
level: error
scope: raw
raw:
- '\n<<<<<<< .+\n|\n=======\n|\n>>>>>>> .+\n'

11 changes: 11 additions & 0 deletions .vale/styles/style_guide/OxfordComma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Suggestion: style_guide.OxfordComma.yml

# Use the Oxford comma, this may not work as intended for complex sentences with many commas
extends: existence
message: "Use the Oxford comma in '%s'."
link: 'https://developers.google.com/style/commas'
scope: sentence
level: suggestion
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
12 changes: 12 additions & 0 deletions .vale/styles/style_guide/Periods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Suggestion: style_guide.Period.yml

# Don't use periods with acronyms. "H.T.M.L" is incorrect, HTML isn't

extends: existence
message: "Don't use periods with acronyms or initialisms such as '%s'."
link: 'https://developers.google.com/style/abbreviations'
level: suggestion
nonword: true
tokens:
- '\b(?:[A-Z]\.){3,}'
10 changes: 10 additions & 0 deletions .vale/styles/style_guide/Repetition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Error: style_guide.Repetition.yml

# catch any instances of repeated words. E.g., "This is is a sentence"
extends: repetition
message: "'%s' is repeated."
level: error
alpha: true
tokens:
- '[^\s]+'
12 changes: 12 additions & 0 deletions .vale/styles/style_guide/Semicolons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Suggestion: style_guide.Semicolons.yml

# If your sentence uses a semicolon, you should break it into two sentences or rewrite it to avoid super long sentences.
extends: existence
message: "Use semicolons judiciously."
link: 'https://developers.google.com/style/semicolons'
nonword: true
scope: sentence
level: suggestion
tokens:
- ';'
15 changes: 15 additions & 0 deletions .vale/styles/style_guide/Spacing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Error: style_guide.Spacing.yml

# Use a space between words, sentences, and punctuation marks
extends: existence
message: "'%s' should have one space."
link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods
level: error
nonword: true
tokens:
- '[a-z]\s{2,}[a-z]' # ensure only one space between words
- '[a-z][.?!:;",] {2,}[A-Z]' # one space between sentences (end. new)
- '[a-z][.?!:;",][A-Z]' #(end.new)
- '[\w.?!,\(\)\-":] {2,}[\w.?!,\(\)\-":]' #only one space after ,.?

9 changes: 9 additions & 0 deletions .vale/styles/style_guide/Spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Warning: style_guide.Spelling.yml

# Checks if your words exist in the dictionary. Any exceptions (including Meilisearch) should be defined in `styles/Vocab/word_list/accept.txt`
extends: spelling
message: "Did you really mean '%s'?"
level: warning
filters:
- 'Vale.*\b'
14 changes: 14 additions & 0 deletions .vale/styles/style_guide/URLFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# Warning: style_guide.URLFormat.yml

# Use "a URL"/"an HTML" instead of "an URL"/"a HTML"
extends: substitution
message: "Use '%s' instead of '%s'."
ignorecase: true
level: warning
action:
name: replace
swap:
URL for: URL of
an URL: a URL
a HTML: an HTML