Skip to content

Commit 00f2ab9

Browse files
Merge pull request #5330 from himeshsiriwardana/vale-integration-2
Integrated Vale into the CI pipeline and included files for local testing
2 parents 2ef6117 + 27a5445 commit 00f2ab9

Some content is hidden

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

54 files changed

+2488
-0
lines changed

.github/workflows/style-checker.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Vale Lint (Changed Markdown Only)
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.md'
7+
8+
jobs:
9+
vale:
10+
name: Vale style check
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write # Needed to post PR comments
14+
contents: read
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Run Vale
23+
uses: errata-ai/vale-action@reviewdog
24+
with:
25+
filter_mode: diff_context
26+
reporter: github-pr-check
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.vale.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
StylesPath = .vale/styles
2+
MinAlertLevel = suggestion
3+
4+
[*.md]
5+
BasedOnStyles = Microsoft, write-good

.vale/styles/Microsoft/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://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '\d{1,2}[AP]M'
8+
- '\d{1,2} ?[ap]m'
9+
- '\d{1,2} ?[aApP]\.[mM]\.'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
extends: existence
2+
message: "Don't use language (such as '%s') that defines people by their disability."
3+
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms
4+
level: suggestion
5+
ignorecase: true
6+
tokens:
7+
- a victim of
8+
- able-bodied
9+
- an epileptic
10+
- birth defect
11+
- crippled
12+
- differently abled
13+
- disabled
14+
- dumb
15+
- handicapped
16+
- handicaps
17+
- healthy person
18+
- hearing-impaired
19+
- lame
20+
- maimed
21+
- mentally handicapped
22+
- missing a limb
23+
- mute
24+
- non-verbal
25+
- normal person
26+
- sight-impaired
27+
- slow learner
28+
- stricken with
29+
- suffers from
30+
- vision-impaired

.vale/styles/Microsoft/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: "'%s' has no definition."
3+
link: https://docs.microsoft.com/en-us/style-guide/acronyms
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

0 commit comments

Comments
 (0)