Skip to content
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

added vale to CLI #2568

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
25 changes: 25 additions & 0 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check Prose with Vale

on:
pull_request:
paths:
- '**/*.md'
push:
paths:
- '**/*.md' # You can specify other file extensions or directories if needed

jobs:
vale:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Vale
run: |
curl -sSL https://github.com/errata-ai/vale/releases/download/v2.12.0/vale_2.12.0_Linux_64-bit.tar.gz | tar -xz -C /tmp
EwoutH marked this conversation as resolved.
Show resolved Hide resolved
sudo mv /tmp/vale /usr/local/bin/vale

- name: Run Vale
run: |
vale .
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ repos:
"--ignore-words",
".codespellignore",
]
exclude: .vale/styles/Microsoft/Avoid.yml
21 changes: 21 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
StylesPath = .vale/styles
MinAlertLevel = warning

[*.md]
BasedOnStyles = Microsoft

# Do not apply any style to .yml files (by simply not defining a style)
[*.yml]
BasedOnStyles =

[.vale/**]
BasedOnStyles =

[.github/**]
BasedOnStyles =

[.vale/styles/Microsoft/**/*.yml]
BasedOnStyles =

[*]
BasedOnStyles =
12 changes: 12 additions & 0 deletions .vale/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Styles": [
{
"Name": "Microsoft",
"Path": "https://github.com/errata-ai/vale/tree/master/styles/Microsoft"
}
],
"MinAlertLevel": "warning",
"Extensions": [
"md"
]
}
9 changes: 9 additions & 0 deletions .vale/styles/Microsoft/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://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms
level: error
nonword: true
tokens:
- '\d{1,2}[AP]M'
- '\d{1,2} ?[ap]m'
- '\d{1,2} ?[aApP]\.[mM]\.'
30 changes: 30 additions & 0 deletions .vale/styles/Microsoft/Accessibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extends: existence
message: "Don't use language (such as '%s') that defines people by their disability."
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms
level: suggestion
ignorecase: true
tokens:
- a victim of
- able-bodied
- an epileptic
- birth defect
- crippled
- differently abled
- disabled
- dumb
- handicapped
- handicaps
- healthy person
- hearing-impaired
- lame
- maimed
- mentally handicapped
- missing a limb
- mute
- non-verbal
- normal person
- sight-impaired
- slow learner
- stricken with
- suffers from
- vision-impaired
64 changes: 64 additions & 0 deletions .vale/styles/Microsoft/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
extends: conditional
message: "'%s' has no definition."
link: https://docs.microsoft.com/en-us/style-guide/acronyms
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
- 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
- REPL
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
Loading
Loading