Skip to content

Commit 812158c

Browse files
authored
Add Vale to RTD pre-commit (#273)
* Add Vale to RTD pre-commit * Fix comment and don't pass args * Add shared vale files * Fix comment * Add ignore * Exclude dev docs * Fix glob
1 parent 3e9b983 commit 812158c

Some content is hidden

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

43 files changed

+1974
-0
lines changed

pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is used in both core application repos (.org and corporate)
2+
13
exclude: '^$|settings|scripts|vendor|\.(min\.js|svg)$|static/.*\.js$'
24
fail_fast: false
35
repos:
@@ -64,3 +66,9 @@ repos:
6466
args: [ --fix ]
6567
# Run the formatter.
6668
- id: ruff-format
69+
70+
repos:
71+
- repo: https://github.com/errata-ai/vale
72+
rev: v3.12.0
73+
hooks:
74+
- id: vale

vale.ini

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
StylesPath = docs/vale/
2+
MinAlertLevel = suggestion
3+
4+
[*.rst]
5+
6+
BasedOnStyles = Vale, RTD, proselint, TheEconomist
7+
Vale.Repetition = YES
8+
9+
# TODO: Enable spelling, but it's currently too noisy
10+
Vale.Spelling = NO
11+
12+
# Initially, some proselint styles were included in vale.
13+
# In later vale versions, those were removed, so now we include
14+
# the full proselint set.
15+
# However, we have a fair bit of legacy that violates the styles
16+
# below, so those are disabled to allow us to move forward for now.
17+
proselint.Very = NO
18+
proselint.But = NO
19+
proselint.Typography = NO
20+
TheEconomist.UnnecessaryWords = NO
21+
22+
23+
; Ignores are a bit janky, do this for now..
24+
25+
[CHANGELOG.rst]
26+
BasedOnStyles =
27+
28+
[docs/dev/*.rst]
29+
BasedOnStyles =

vale/RTD/sso.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: substitution
2+
message: Use 'Single sign-on' instead of '%s'
3+
level: warning
4+
swap:
5+
Single Sign-On: Single sign-on
6+
Single Sign on: Single sign-on
7+
single sign-on: Single sign-on
8+
single Sign-On: Single sign-on
9+
single Sign on: Single sign-on

vale/RTD/style.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: substitution
2+
message: Use '%s' instead of '%s'
3+
level: error
4+
swap:
5+
Read The Docs: Read the Docs
6+
RTD: Read the Docs
7+
ReadTheDocs: Read the Docs

vale/TheEconomist/Hectoring.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extends: existence
2+
message: "'%s' - Do not be hectoring or arrogant"
3+
description: "Those who disagree with you are not necessarily '%s.'"
4+
link: http://www.economist.com/styleguide/introduction
5+
scope: text
6+
level: warning
7+
ignorecase: true
8+
tokens:
9+
- stupid
10+
- idiotic
11+
- imbecile
12+
- ignorant
13+
- insane
14+
- absurd
15+
- ridiculous
16+
- lunatic
17+
- asinine
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
extends: existence
2+
message: "'%s' - See section 'Unnecessary words'"
3+
level: warning
4+
scope: text
5+
description: Some words add nothing but length to your prose.
6+
link: http://www.economist.com/style-guide/unnecessary-words
7+
ignorecase: true
8+
tokens:
9+
- any time soon
10+
- bought up
11+
- cut back
12+
- cutbacks
13+
- for free
14+
- free gift
15+
- freed up
16+
- hatched up
17+
- headed up by
18+
- large-scale
19+
- meet with
20+
- Most especially
21+
- Most probably
22+
- policymaking process
23+
- safe haven
24+
- sale events
25+
- sent off to bed
26+
- so-called
27+
- sold off
28+
- strike action
29+
- The fact that
30+
- This time around
31+
- top priority
32+
- track record
33+
- weather conditions
34+
- wilderness area

vale/TheEconomist/style.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Based on [The Economist](http://www.economist.com/styleguide/introduction).

vale/proselint/Airlinese.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' is airlinese."
3+
ignorecase: true
4+
level: error
5+
tokens:
6+
- enplan(?:e|ed|ing|ement)
7+
- deplan(?:e|ed|ing|ement)
8+
- taking off momentarily

vale/proselint/AnimalLabels.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
extends: substitution
2+
message: "Consider using '%s' instead of '%s'."
3+
level: error
4+
action:
5+
name: replace
6+
swap:
7+
(?:bull|ox)-like: taurine
8+
(?:calf|veal)-like: vituline
9+
(?:crow|raven)-like: corvine
10+
(?:leopard|panther)-like: pardine
11+
bird-like: avine
12+
centipede-like: scolopendrine
13+
crab-like: cancrine
14+
crocodile-like: crocodiline
15+
deer-like: damine
16+
eagle-like: aquiline
17+
earthworm-like: lumbricine
18+
falcon-like: falconine
19+
ferine: wild animal-like
20+
fish-like: piscine
21+
fox-like: vulpine
22+
frog-like: ranine
23+
goat-like: hircine
24+
goose-like: anserine
25+
gull-like: laridine
26+
hare-like: leporine
27+
hawk-like: accipitrine
28+
hippopotamus-like: hippopotamine
29+
lizard-like: lacertine
30+
mongoose-like: viverrine
31+
mouse-like: murine
32+
ostrich-like: struthionine
33+
peacock-like: pavonine
34+
porcupine-like: hystricine
35+
rattlesnake-like: crotaline
36+
sable-like: zibeline
37+
sheep-like: ovine
38+
shrew-like: soricine
39+
sparrow-like: passerine
40+
swallow-like: hirundine
41+
swine-like: suilline
42+
tiger-like: tigrine
43+
viper-like: viperine
44+
vulture-like: vulturine
45+
wasp-like: vespine
46+
wolf-like: lupine
47+
woodpecker-like: picine
48+
zebra-like: zebrine

vale/proselint/Annotations.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: existence
2+
message: "'%s' left in text."
3+
ignorecase: false
4+
level: error
5+
tokens:
6+
- XXX
7+
- FIXME
8+
- TODO
9+
- NOTE

0 commit comments

Comments
 (0)