mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Add Vale linting for our docs
- I noticed that another open source project had taken the Homebrew style guide and made it into [Vale linting rules](https://github.com/testthedocs/vale-styles/tree/master/Homebrew). This copies them into here, so that we can make use of them. Thanks! - What use is a style guide if our own docs don't at least try to adhere to it? This aims to make the rules more visible to all contributors. - In order for these to do anything, you'll have to `brew install vale` and run `vale` in the root of this repo. It will look for Markdown files. - A next step would be adding this as a pre-commit hook, or... - The GitHub Action would have been really good, but [it doesn't support forks](https://github.com/errata-ai/vale-action#limitations).
This commit is contained in:
parent
205a08653b
commit
2a53448685
@ -7,6 +7,7 @@ exclude:
|
|||||||
- bin
|
- bin
|
||||||
- CNAME
|
- CNAME
|
||||||
- Gemfile*
|
- Gemfile*
|
||||||
|
- vale-styles
|
||||||
- vendor
|
- vendor
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
|
12
docs/vale-styles/Homebrew/Abbreviations.yml
Normal file
12
docs/vale-styles/Homebrew/Abbreviations.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
extends: substitution
|
||||||
|
message: Use '%s'
|
||||||
|
ignorecase: false
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#style-and-usage'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
swap:
|
||||||
|
'\beg\b': e.g.
|
||||||
|
'\bie\b': i.e.
|
||||||
|
'e\.g\.,': e.g.
|
||||||
|
'i\.e\.,': i.e.
|
8
docs/vale-styles/Homebrew/OxfordComma.yml
Normal file
8
docs/vale-styles/Homebrew/OxfordComma.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
extends: existence
|
||||||
|
message: 'No Oxford commas!'
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#typographical-conventions'
|
||||||
|
scope: sentence
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- '(?:[^,]+,){1,}\s\w+,\sand'
|
15
docs/vale-styles/Homebrew/Pronouns.yml
Normal file
15
docs/vale-styles/Homebrew/Pronouns.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
extends: existence
|
||||||
|
message: Avoid gender-specific language when not necessary.
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#personal-pronouns'
|
||||||
|
level: warning
|
||||||
|
ignorecase: true
|
||||||
|
tokens:
|
||||||
|
- him
|
||||||
|
- her
|
||||||
|
- she
|
||||||
|
- he
|
||||||
|
- his
|
||||||
|
- hers
|
||||||
|
- himself
|
||||||
|
- herself
|
1
docs/vale-styles/Homebrew/README.md
Normal file
1
docs/vale-styles/Homebrew/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Based on Homebrew's [Prose Style Guidelines](http://docs.brew.sh/Prose-Style-Guidelines.html).
|
9
docs/vale-styles/Homebrew/Spacing.yml
Normal file
9
docs/vale-styles/Homebrew/Spacing.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
extends: existence
|
||||||
|
message: "'%s' should have one space."
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#typographical-conventions'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- '[a-z][.?!][A-Z]'
|
||||||
|
- '[.?!] {2,}[A-Z]'
|
9
docs/vale-styles/Homebrew/Terms.yml
Normal file
9
docs/vale-styles/Homebrew/Terms.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
extends: substitution
|
||||||
|
message: Use '%s' instead of '%s'.
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#terminology-words-and-word-styling'
|
||||||
|
level: error
|
||||||
|
swap:
|
||||||
|
Pull Request: pull request
|
||||||
|
repo: repository
|
||||||
|
Rubocop: RuboCop
|
6
docs/vale-styles/Homebrew/Titles.yml
Normal file
6
docs/vale-styles/Homebrew/Titles.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
extends: capitalization
|
||||||
|
message: "'%s' should be in sentence case"
|
||||||
|
level: warning
|
||||||
|
scope: heading
|
||||||
|
match: $sentence
|
12
docs/vale-styles/Homebrew/Trademarks.yml
Normal file
12
docs/vale-styles/Homebrew/Trademarks.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
extends: existence
|
||||||
|
message: 'No "TM", ™, SM, ©, ®, or other explicit indicators of rights ownership or trademarks'
|
||||||
|
link: 'https://github.com/Homebrew/brew/blob/master/docs/Prose-Style-Guidelines.md#typographical-conventions'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- \bTM\b
|
||||||
|
- ™
|
||||||
|
- \bSM\b
|
||||||
|
- ©
|
||||||
|
- ®
|
Loading…
x
Reference in New Issue
Block a user