Skip to content

Commit 14ac8e7

Browse files
authored
docs(workflow): add Vale Linting workflow (#9)
* docs(workflow): add Vale configuration file Signed-off-by: Christine <shecoder30@gmail.com> * docs(workflow): add Vale Linting workflow Signed-off-by: Christine <shecoder30@gmail.com> --------- Signed-off-by: Christine <shecoder30@gmail.com>
1 parent 54d79f1 commit 14ac8e7

73 files changed

Lines changed: 2619 additions & 0 deletions

Some content is hidden

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

.github/workflows/vale.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Vale Linting and Link Checking
2+
# Trigger the workflow on push to main branch and pull requests
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
vale-lint:
11+
runs-on: ubuntu-latest
12+
name: Vale Linting
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Vale
19+
uses: errata-ai/vale-action@reviewdog
20+
with:
21+
# Install Vale and sync packages
22+
files: '**/*.md **/*.mdx'
23+
version: '3.4.2'
24+
env:
25+
# Required for Vale action
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
link-check:
29+
runs-on: ubuntu-latest
30+
name: Broken Link Check
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Check links in markdown files
37+
uses: gaurav-nelson/github-action-markdown-link-check@v1
38+
with:
39+
# Check all .md and .mdx files in the repository
40+
use-quiet-mode: 'yes'
41+
use-verbose-mode: 'yes'
42+
config-file: '.markdown-link-check.json'
43+
folder-path: '.'
44+
file-extension: '.md .mdx'

.markdown-link-check.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http://localhost"
5+
}
6+
],
7+
"timeout": "20s",
8+
"retryOn429": true,
9+
"retryCount": 2,
10+
"fallbackRetryDelay": "30s",
11+
"aliveStatusCodes": [200, 206]
12+
}

styles/.vale-config/2-MDX.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.mdx]
2+
# Exclude:
3+
#
4+
# - Non-JS inline expressions (which cause Acorn to throw)
5+
TokenIgnores = '({#[^\n}]+})(?!`)'

styles/Google/AMPM.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Use 'AM' or 'PM' (preceded by a space)."
3+
link: "https://developers.google.com/style/word-list"
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '\d{1,2}[AP]M\b'
8+
- '\d{1,2} ?[ap]m\b'
9+
- '\d{1,2} ?[aApP]\.[mM]\.'

styles/Google/Acronyms.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
extends: conditional
2+
message: "Spell out '%s', if it's unfamiliar to the audience."
3+
link: 'https://developers.google.com/style/abbreviations'
4+
level: suggestion
5+
ignorecase: false
6+
# Ensures that the existence of 'first' implies the existence of 'second'.
7+
first: '\b([A-Z]{3,5})\b'
8+
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
9+
# ... with the exception of these:
10+
exceptions:
11+
- API
12+
- ASP
13+
- CLI
14+
- CPU
15+
- CSS
16+
- CSV
17+
- DEBUG
18+
- DOM
19+
- DPI
20+
- FAQ
21+
- GCC
22+
- GDB
23+
- GET
24+
- GPU
25+
- GTK
26+
- GUI
27+
- HTML
28+
- HTTP
29+
- HTTPS
30+
- IDE
31+
- JAR
32+
- JSON
33+
- JSX
34+
- LESS
35+
- LLDB
36+
- NET
37+
- NOTE
38+
- NVDA
39+
- OSS
40+
- PATH
41+
- PDF
42+
- PHP
43+
- POST
44+
- RAM
45+
- REPL
46+
- RSA
47+
- SCM
48+
- SCSS
49+
- SDK
50+
- SQL
51+
- SSH
52+
- SSL
53+
- SVG
54+
- TBD
55+
- TCP
56+
- TODO
57+
- URI
58+
- URL
59+
- USB
60+
- UTF
61+
- XML
62+
- XSS
63+
- YAML
64+
- ZIP

styles/Google/Colons.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: existence
2+
message: "'%s' should be in lowercase."
3+
link: 'https://developers.google.com/style/colons'
4+
nonword: true
5+
level: warning
6+
scope: sentence
7+
tokens:
8+
- '(?<!:[^ ]+?):\s[A-Z]'

styles/Google/Contractions.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
link: 'https://developers.google.com/style/contractions'
4+
level: suggestion
5+
ignorecase: true
6+
action:
7+
name: replace
8+
swap:
9+
are not: aren't
10+
cannot: can't
11+
could not: couldn't
12+
did not: didn't
13+
do not: don't
14+
does not: doesn't
15+
has not: hasn't
16+
have not: haven't
17+
how is: how's
18+
is not: isn't
19+
it is: it's
20+
should not: shouldn't
21+
that is: that's
22+
they are: they're
23+
was not: wasn't
24+
we are: we're
25+
we have: we've
26+
were not: weren't
27+
what is: what's
28+
when is: when's
29+
where is: where's
30+
will not: won't

styles/Google/DateFormat.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "Use 'July 31, 2016' format, not '%s'."
3+
link: 'https://developers.google.com/style/dates-times'
4+
ignorecase: true
5+
level: error
6+
nonword: true
7+
tokens:
8+
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
9+
- '\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}'

styles/Google/Ellipses.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "In general, don't use an ellipsis."
3+
link: 'https://developers.google.com/style/ellipses'
4+
nonword: true
5+
level: warning
6+
action:
7+
name: remove
8+
tokens:
9+
- '\.\.\.'

styles/Google/EmDash.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Don't put a space before or after a dash."
3+
link: "https://developers.google.com/style/dashes"
4+
nonword: true
5+
level: error
6+
action:
7+
name: edit
8+
params:
9+
- trim
10+
- " "
11+
tokens:
12+
- '\s[—–]\s'
13+

0 commit comments

Comments
 (0)