Skip to content

Commit

Permalink
add vale linter
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjie committed Jan 25, 2022
1 parent f4ac58b commit ecb967e
Show file tree
Hide file tree
Showing 42 changed files with 855 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/styles/Agora/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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:
- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DITA
- DOM
- DPI
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- RTC
- RTM
- RSA
- SCM
- SCSS
- SD-RTN
- SDK
- SQL
- SSH
- SSL
- SVG
- TCP
- UDP
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
6 changes: 6 additions & 0 deletions .github/styles/Agora/Characters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: "Illegal character"
level: error
nonword: true
tokens:
- '[^\sa-zA-Z0-9™#%*+=@&~|<>(){}:"''.,?/_-]'
8 changes: 8 additions & 0 deletions .github/styles/Agora/Colons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "'%s' should be in uppercase."
link: "https://developers.google.com/style/colons"
nonword: true
level: warning
scope: sentence
tokens:
- ':\s[a-z]'
30 changes: 30 additions & 0 deletions .github/styles/Agora/Contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extends: substitution
message: "Use '%s' instead of '%s'."
scope: sentence
level: suggestion
ignorecase: true
action:
name: replace
swap:
aren't: are not
can't: cannot
couldn't: could not
didn't: did not
don't: do not
doesn't: does not
hasn't: has not
haven't: have not
how's: how is
isn't: is not
it's: it is
shouldn't: should not
that's: that is
they're: they are
wasn't: was not
we're: we are
we've: we have
weren't: were not
what's: what is
when's: when is
where's: where is
won't: will not
50 changes: 50 additions & 0 deletions .github/styles/Agora/Headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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:
- Agora Analytics
- Agora Cloud Recording
- Agora Console
- Agora Interactive Live Streaming Premium
- Agora Interactive Live Streaming Standard
- Agora Interactive Whiteboard
- Agora MediaPlayer Kit
- Agora On-premise Recording SDK
- Agora Real-time Messaging
- Agora RTM SDK
- Agora SD-RTN
- Agora Video Call
- Agora Video SDK
- Agora Voice Call
- Agora Voice SDK
- AI Interactive Classroom
- Azure
- Breakout Class
- Lecture Hall
- CLI
- Code
- Docker
- I
- Kubernetes
- Linux
- Live-stream Shopping
- macOS
- Marketplace
- MongoDB
- Multiple Hosts
- One-to-one Classroom
- PK Host
- Small Classroom
- Single Host
- Studio
- TypeScript
- URLs
- Virtual Host
- Visual
- VS
- Windows
8 changes: 8 additions & 0 deletions .github/styles/Agora/Link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
message: "Don't use '%s' as the content of a link."
extends: existence
ignorecase: true
scope: link
level: error
tokens:
- here
- this
11 changes: 11 additions & 0 deletions .github/styles/Agora/Spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: spelling
message: "Did you really mean '%s'?"
level: error
ignore:
# Relative path to StylesPath
- ignore.txt
# The default dictionary is https://github.com/errata-ai/en_US-web
# Comment out the following to use custom .dic files
# dicpath: ../../fixtures/spelling/dics
# dictionaries:
# - en_US
88 changes: 88 additions & 0 deletions .github/styles/Agora/WordList.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: "https://agoradoc-style-guide.readthedocs.io/en/latest/overview.html"
level: warning
ignorecase: false
action:
name: replace
swap:
"(?:back-end|back ?end)": backend
"(?:cell ?phone|smart ?phone)": phone|mobile phone
"(?:e-mail|Email|E-mail)": email
"(?:file ?path|path ?name)": path
"(?:kill|terminate|abort)": stop|exit|cancel|end
"(?:lastmile|last-mile)": last mile
"(?:WiFi|wifi)": Wi-Fi
"(?:unarchive|uncompress|unzip)": extract
'[\.]+apk': APK
'3\-D': 3D
"tap (?:&|and) hold": touch & hold
"un(?:check|select)": clear
above: preceding
account name: username
action bar: app bar
admin: administrator
agora: Agora
Ajax: AJAX
android: Android
application: app
approx\.: approximately
audio capture: audio sample
audio sampling rate: audio sample rate
autoupdate: automatically update
BETA: beta
bit rate: bitrate
bluetooth: Bluetooth
boolean: Boolean
cellular data: mobile data
cellular network: mobile network
chapter: documents|pages|sections
check box: checkbox
CLI: command-line tool
click on: click|click in
data are: data is
demonstrate: show
disabled?: turn off|off
dual streams: dual stream
enter a channel: join a channel
fewer data: less data
file name: filename
firewalls: firewall rules
functionality: capability|feature
Googling: search with Google
grayed-out: unavailable
H5: HTML5
HTTPs: HTTPS
illegal: invalid
in order to: to
ingest: import|load
Internet: internet
ios: iOS
k8s: Kubernetes
long press: touch & hold
mac: Mac
MacOS: macOS
multi-channel: multichannel
multi-media: multimedia
multi-threaded: multithreaded
open-source: open source
re-integrate: reintegrate
regex: regular expression
SD-RTN: SD-RTN™
SHA1: SHA-1|HAS-SHA1
sign into: sign in to
sign-?on: single sign-on
stylesheet: style sheet
tablet: device
the dual-stream mode: dual-stream mode
This article: This page
this article: this page
touch: tap
uid: user ID
uri: URI
url: URL
user name: username
video capturing: video capture
vs\.: versus
World Wide Web: web
wrong: incorrect
9 changes: 9 additions & 0 deletions .github/styles/Google/AMPM.yml
Original file line number Diff line number Diff line change
@@ -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]\.'
9 changes: 9 additions & 0 deletions .github/styles/Google/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: 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}'
9 changes: 9 additions & 0 deletions .github/styles/Google/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: warning
action:
name: remove
tokens:
- '\.\.\.'
12 changes: 12 additions & 0 deletions .github/styles/Google/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: error
action:
name: edit
params:
- remove
- " "
tokens:
- '\s[—–]\s'
13 changes: 13 additions & 0 deletions .github/styles/Google/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: error
action:
name: edit
params:
- replace
- "-"
- ""
tokens:
- ""
7 changes: 7 additions & 0 deletions .github/styles/Google/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: error
tokens:
- '\w!(?:\s|$)'
13 changes: 13 additions & 0 deletions .github/styles/Google/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: warning
nonword: true
tokens:
- (?:^|\s)I\s
- (?:^|\s)I,\s
- \bI'm\b
- \bme\b
- \bmy\b
- \bmine\b
9 changes: 9 additions & 0 deletions .github/styles/Google/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: error
ignorecase: true
tokens:
- he/she
- s/he
- \(s\)he
Loading

0 comments on commit ecb967e

Please sign in to comment.