Experiment with Vale

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
This commit is contained in:
Mihovil Ilakovac 2024-03-21 11:20:04 +01:00
parent f255fb834c
commit 0c717a7533
34 changed files with 609 additions and 0 deletions

16
web/.vale.ini Normal file
View File

@ -0,0 +1,16 @@
StylesPath = vale/styles
MinAlertLevel = suggestion
Vocab = Wasp
Packages =
[formats]
mdx = md
[*.{md,txt,mdx}]
BasedOnStyles = Vale, Custom
Vale.Terms = NO

View File

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

View File

@ -0,0 +1,71 @@
extends: conditional
message: "The first instance of '%s' should be spelled out, followed by the acronym in brackets. For example: 'Data Definition Language (DDL)'"
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:
- API
- ARM
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DOM
- DPI
- FAQ
- GCC
- GDB
- GDPR
- GET
- GPT
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- IMDB
- JAR
- JSON
- JSX
- JWT
- LESS
- LLDB
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- REPL
- REST
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- URI
- URL
- USB
- USD
- UTF
- XML
- XSS
- YAML
- ZIP

View File

@ -0,0 +1,11 @@
extends: substitution
message: "Captalize this to make it a proper noun: '%s' -> '%s'"
link: 'https://developers.google.com/style/word-list'
level: warning
ignorecase: false
action:
name: replace
swap:
auth hooks?: Auth Hooks?
edge functions?: Edge Functions?
'role[- ]?based access control': Role-Based Access Control

View File

@ -0,0 +1,8 @@
extends: existence
message: "'%s' should be in lowercase."
link: 'https://developers.google.com/style/colons'
nonword: true
level: warning
scope: sentence
tokens:
- ':\s[A-Z]'

View File

@ -0,0 +1,30 @@
extends: substitution
message: "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

View File

@ -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: error
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}'

View File

@ -0,0 +1,9 @@
extends: existence
message: "In general, don't use an ellipsis."
link: 'https://developers.google.com/style/ellipses'
nonword: true
level: warning
action:
name: remove
tokens:
- '\.\.\.'

View File

@ -0,0 +1,13 @@
extends: existence
message: "Don't put a space before or after a dash."
link: "https://developers.google.com/style/dashes"
nonword: true
level: error
action:
name: edit
params:
- trim
- " "
tokens:
- '\s[—–]\s'

View File

@ -0,0 +1,9 @@
extends: existence
message: "Don't use '%s'. The sentence is more concise and/or the tone is more neutral without it."
ignorecase: true
level: error
tokens:
- easily
- please
- simply
- that's it

View File

@ -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: warning
nonword: true
tokens:
- (?:^|\s)I\s
- (?:^|\s)I,\s
- \bI'm\b
- \bme\b
- \bmy\b
- \bmine\b

View File

@ -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: error
ignorecase: true
tokens:
- he/she
- s/he
- \(s\)he

View File

@ -0,0 +1,47 @@
extends: substitution
message: "Consider using '%s' instead of '%s'."
link: 'https://developers.google.com/style/inclusive-documentation'
ignorecase: true
level: error
action:
name: replace
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)

View File

@ -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: warning
scope: heading
action:
name: edit
params:
- trim_right
- "."
tokens:
- '[a-z0-9][.]\s*$'

View File

@ -0,0 +1,37 @@
extends: capitalization
message: "'%s' should use sentence-style capitalization."
link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings"
level: warning
scope: heading
match: $sentence
indicators:
- ":"
exceptions:
- API
- Azure
- ChatGPT
- ChatGPT Retrieval Plugin
- CLI
- Cosmos
- Docker
- Edge Functions?
- Emmet
- gRPC
- HNSW
- I
- JWT
- Kubernetes
- Linux
- macOS
- Marketplace
- MongoDB
- OpenAI
- REPL
- REST
- Studio
- Transformers.js
- TypeScript
- URLs
- Visual
- VS
- Windows

View File

@ -0,0 +1,11 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: true
level: error
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)(?=[\s,;])': for example
'\b(?:ie|i\.e\.)(?=[\s,;])': that is

View File

@ -0,0 +1,14 @@
extends: existence
message: "'%s' doesn't need a hyphen."
link: "https://developers.google.com/style/hyphens"
level: error
ignorecase: false
nonword: true
action:
name: edit
params:
- regex
- "-"
- " "
tokens:
- '\b[^\s-]+ly-\w+\b'

View File

@ -0,0 +1,12 @@
extends: existence
message: "Don't use plurals in parentheses such as in '%s'."
link: "https://developers.google.com/style/plurals-parentheses"
level: error
nonword: true
action:
name: edit
params:
- trim_right
- "(s)"
tokens:
- '\b\w+\(s\)'

View File

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

View File

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

View File

@ -0,0 +1,8 @@
extends: existence
message: "Use parentheses judiciously."
link: 'https://developers.google.com/style/parentheses'
nonword: true
level: suggestion
tokens:
# Ignore acronym definitions
- '\([^A-Z]+\)'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Don't use periods with acronyms or initialisms such as '%s'."
link: 'https://developers.google.com/style/abbreviations'
level: error
nonword: true
tokens:
- '\b(?:[A-Z]\.){3,}'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Commas and periods go inside quotation marks."
link: 'https://developers.google.com/style/quotation-marks'
level: error
nonword: true
tokens:
- '"[^"]+"[.,?]'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Don't add words such as 'from' or 'between' to describe a range of numbers."
link: 'https://developers.google.com/style/hyphens'
nonword: true
level: warning
tokens:
- '(?:from|between)\s\d+\s?-\s?\d+'

View File

@ -0,0 +1,8 @@
extends: existence
message: "Use semicolons judiciously."
link: 'https://developers.google.com/style/semicolons'
nonword: true
scope: sentence
level: suggestion
tokens:
- ';'

View File

@ -0,0 +1,11 @@
extends: existence
message: "Don't use internet slang abbreviations such as '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: true
level: error
tokens:
- 'tl;dr'
- ymmv
- rtfm
- imo
- fwiw

View File

@ -0,0 +1,10 @@
extends: existence
message: "'%s' should have one space."
link: 'https://developers.google.com/style/sentence-spacing'
level: error
nonword: true
action:
name: remove
tokens:
- '[a-z][.?!] {2,}[A-Z]'
- '[a-z][.?!][A-Z]'

View File

@ -0,0 +1,10 @@
extends: existence
message: "In general, use American spelling instead of '%s'."
link: 'https://developers.google.com/style/spelling'
ignorecase: true
level: warning
tokens:
- '(?:\w+)nised?'
- 'colour'
- 'labour'
- 'centre'

View File

@ -0,0 +1,8 @@
extends: existence
message: "Put a nonbreaking space between the number and the unit in '%s'."
link: "https://developers.google.com/style/units-of-measure"
nonword: true
level: error
tokens:
- \b\d+(?:B|kB|MB|GB|TB)
- \b\d+(?:ns|ms|s|min|h|d)

View File

@ -0,0 +1,11 @@
extends: existence
message: "Try to avoid using first-person plural like '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
level: warning
ignorecase: true
tokens:
- we
- we'(?:ve|re)
- ours?
- us
- let's

View File

@ -0,0 +1,90 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/word-list'
level: warning
ignorecase: false
action:
name: replace
swap:
'(?:API Console|dev|developer) key': API key
'(?:cell ?phone|smart ?phone)': phone|mobile phone
'(?:dev|developer|APIs) console': API console
'(?:e-mail|Email|E-mail)': email
'(?:file ?path|path ?name)': path
'(?:kill|terminate|abort)': stop|exit|cancel|end
'(?:Nginx|nginx)': NGINX
'(?:OAuth ?2|Oauth)': OAuth 2.0
'(?:ok|Okay)': OK|okay
'(?:WiFi|wifi)': Wi-Fi
'(?i)postgresql': Postgres
'[\.]+apk': APK
'3\-D': 3D
'Google (?:I\-O|IO)': Google I/O
'Next(?:js)?': Next.js (if referring to the framework)
'tap (?:&|and) hold': touch & hold
'un(?:check|select)': clear
'utili[sz](?:e[ds]|ing)': use, used, uses, etc.
above: preceding
account name: username
action bar: app bar
Ajax: AJAX
a\.k\.a|aka: or|also known as
Android device: Android-powered device
android: Android
API explorer: APIs Explorer
approx\.: approximately
authN: authentication
authZ: authorization
autogenerated: auto-generated
autoupdate: automatically update
cellular data: mobile data
cellular network: mobile network
chapter: documents|pages|sections
check box: checkbox
check: select
click on: click|click in
Cloud: Google Cloud Platform|GCP
Container Engine: Kubernetes Engine
content type: media type
curated roles: predefined roles
data are: data is
Developers Console: Google API Console|API Console
disabled?: turn off|off
ephemeral IP address: ephemeral external IP address
fewer data: less data
file name: filename
firewalls: firewall rules
functionality: capability|feature
Github: GitHub
Google account: Google Account
Google accounts: Google Accounts
Googling: search with Google
grayed-out: unavailable
head over to: go to|see
HTTPs: HTTPS
in order to: to
ingest: import|load
k8s: Kubernetes
long press: touch & hold
network IP address: internal IP address
omnibox: address bar
open-source: open source
overview screen: recents screen
regex: regular expression
refer to: see
serverside: server-side
SHA1: SHA-1|HAS-SHA1
sign into: sign in to
sign-ins?: signin(s) (noun) or sign in (verb)
sign-?on: single sign-on
sign-outs?: signout(s) (noun) or sign out (verb)
sign-ups?: signup(s) (noun) or sign up (verb)
static IP address: static external IP address
stylesheet: style sheet
synch: sync
tablename: table name
tablet: device
touch: tap
url: URL
vs\.: versus
World Wide Web: web

View File

@ -0,0 +1,4 @@
{
"feed": "https://github.com/errata-ai/Google/releases.atom",
"vale_version": ">=1.0.0"
}

View File

View File

@ -0,0 +1,73 @@
Dockerfile
Prisma
dotenv
env|Env
async
middleware|Middleware
config|Config
Vite
dev|Dev
OAuth
GitHub
Google
favicon
npm|NPM
Netlify
setupFn
Mailgun
useQuery
useAction
superjson
getters
Keycloak
Vue
basename
Todo|TODO
apiNamespace
api|API
Pinecone
[S|s]ignup
getAll
enum|Enum
VSCode
cron
Matija
urlencoded
cookieParser
nvm|NVM
Axios
params|param
bool|psl|json
Rollup
webpack|Webpack
Gitpod
invalidations
refetch
onwards
hstore
unregistering
unmount
deserialize
deserializing
serializable
rethrow
declaratively
Javascript|JavaScript
Grammarly
Git[h|H]ub
validators
Asana
namespaced
VMs
datacenters
Anycast
Paolo
sanitization
anonymized
learnings
destructure
jargony
repo
URIs
Waspeteer
Mx