Skip to content

Commit

Permalink
Merge pull request #6 from m4sterbunny/update-vale
Browse files Browse the repository at this point in the history
Sets up Vale
  • Loading branch information
joshuafernandes authored Aug 22, 2024
2 parents e3a2353 + 0b48f60 commit a9035bc
Show file tree
Hide file tree
Showing 96 changed files with 4,440 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Docs GitHub actions

https://github.com/Consensys/docs-gha acts as a single source of truth (sot) for actions that keep
the docs sites shiny.

## Work in progress

### ES lint

ES lint ignores .md and .mdx. Need to test whether it can lint codeblocks within those files.

### Vale

[Vale](https://vale.sh/docs/) is currently [WIP for use locally and as GH action](spelling/README.md).

6 changes: 3 additions & 3 deletions spelling/config/.vale.ini → spelling/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Styles directory
# See vale_styles/README.md file for details and licencing information
StylesPath = .docs-gha/spelling/styles
StylesPath = ./styles

Packages = proselint, Microsoft, write-good

Vocab = Consensys
Vocab = Consensys-common

# The minimum alert level to display (suggestion, warning, or error).
# CI builds will only fail on error-level alerts.
Expand Down Expand Up @@ -35,7 +35,7 @@ Microsoft.Contractions = warning
Microsoft.GeneralURL = NO
# Microsoft.Acronyms is replaced by Consensys list
Microsoft.Acronyms = NO
Microsoft.Headings = NO
Microsoft.Headings = YES

write-good.Weasel = NO

Expand Down
45 changes: 45 additions & 0 deletions spelling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Vale

[Vale](https://vale.sh/docs/) is currently WIP for use locally and as GH action.

## Get started with Vale

https://passo.uno/posts/first-steps-with-the-vale-prose-linter/ provides a decent quickstart (but
get [install from main docs](https://vale.sh/docs/vale-cli/installation/)).


## Vale commands

Grab the to-date version of a style package referenced in the vale.ini with:

```bash
vale sync
```

> Microsoft is sourced from https://github.com/errata-ai/Microsoft
To run Vale against all relevant files in repo, use:

```bash
vale .
```

Or pass Vale the path to the file you want to lint, e.g. lint this file with:

```bash
vale README.md
```

> For help with Regex expression building use [Regex101](https://regex101.com).
Vale is currently wip. The Vale resources and project-word resources from several sites will
be compiled to this one sot.

## Vale and Yaml?

If API specs are managed as YAML files, need to test whether Vale can handle linting YAMLs.

## Testing Vale Here

This heading should trigger warning for non-compliance with sentence case. Metamask should upset
Vale too.
2 changes: 2 additions & 0 deletions spelling/styles/Consensys/Acronyms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exceptions:
- ECDSA
- ETH
- EVM
- ES
- GET
- GPU
- gRPC
Expand Down Expand Up @@ -57,4 +58,5 @@ exceptions:
- WEI
- XML
- YAML
- yaml
- ZIP
6 changes: 3 additions & 3 deletions spelling/styles/Consensys/Weasel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tokens:
- accidentally
- additionally
- allegedly
- alternatively
# - alternatively
- angrily
- anxiously
- approximately
Expand All @@ -31,15 +31,15 @@ tokens:
- clearly
- closely
- coldly
- completely
# - completely
- consequently
- correctly
- courageously
- crinkly
- cruelly
- crumbly
- cuddly
- currently
# - currently
- daily
- daringly
- deadly
Expand Down
9 changes: 9 additions & 0 deletions spelling/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 spelling/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 spelling/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

0 comments on commit a9035bc

Please sign in to comment.