Skip to content

Commit 887e0e0

Browse files
committed
Add Vale for content linting to the repo
1 parent e0bff39 commit 887e0e0

24 files changed

Lines changed: 267 additions & 22 deletions

File tree

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ body:
99
attributes:
1010
label: Is Your Feature Request Related to a Problem? Please Describe
1111
description: A clear and concise description of what the problem is.
12-
placeholder: I'm always frustrated when [...]
12+
placeholder: I'm always frustrated when []
1313
validations:
1414
required: true
1515
- id: solution
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
# This style is taken from the official GitLab style and updated to use British spelling instead of US spelling
3+
# Error: livewyer.British
4+
#
5+
# Checks that British spelling is used instead of US spelling.
6+
#
7+
# For a list of all options, see https://vale.sh/docs/topics/styles/
8+
extends: substitution
9+
message: "Use the British spelling '%s' instead of the US '%s'."
10+
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language
11+
level: error
12+
ignorecase: true
13+
swap:
14+
eon: aeon
15+
airplane: aeroplane
16+
aging: ageing
17+
aluminum: aluminium
18+
anemia: anaemia
19+
minimize: minimise
20+
anesthesia: anaesthesia
21+
analyze: analyse
22+
annex: annexe
23+
apologize: apologise
24+
authorize: authorise
25+
authorized: authorised
26+
authorization: authorisation
27+
authorizing: authorising
28+
behavior: behaviour
29+
buses: busses
30+
caliber: calibre
31+
categorize: categorise
32+
categorized: categorised
33+
categorizes: categorises
34+
categorizing: categorising
35+
center: centre
36+
civilization: civilisation
37+
civilize: civilise
38+
color: colour
39+
cozy: cosy
40+
cipher: cypher
41+
dependent: dependant
42+
defense: defence
43+
distill: distil
44+
draft: draught
45+
encyclopedia: encyclopaedia
46+
inquiry: enquiry
47+
enroll: enrol
48+
enrollment: enrolment
49+
enthrall: enthral
50+
favorite: favourite
51+
fiber: fibre
52+
filet: fillet
53+
flavor: flavour
54+
furor: furore
55+
fulfill: fulfil
56+
jail: gaol
57+
gray: grey
58+
humor: humour
59+
honor: honour
60+
initialed: initialled
61+
initialing: initialling
62+
instill: instil
63+
jewelry: jewellery
64+
labeling: labelling
65+
labeled: labelled
66+
labor: labour
67+
libelous: libellous
68+
license: licence
69+
likable: likeable
70+
livable: liveable
71+
luster: lustre
72+
maneuver: manoeuvre
73+
marvelous: marvellous
74+
matte: matt
75+
meager: meagre
76+
meter: metre
77+
modeling: modelling
78+
mustache: moustache
79+
neighbor: neighbour
80+
normalize: normalise
81+
offense: offence
82+
optimize: optimise
83+
optimized: optimised
84+
optimizing: optimising
85+
organize: organise
86+
oriented: orientated
87+
paralyze: paralyse
88+
plow: plough
89+
pretense: pretence
90+
pajamas: pyjamas
91+
ratable: rateable
92+
realize: realise
93+
recognize: recognise
94+
reconnoiter: reconnoitre
95+
rumor: rumour
96+
saber: sabre
97+
salable: saleable
98+
saltpeter: saltpetre
99+
skeptic: sceptic
100+
sepulcher: sepulchre
101+
signaling: signalling
102+
sizable: sizeable
103+
skillful: skilful
104+
somber: sombre
105+
smolder: smoulder
106+
specialty: speciality
107+
specter: spectre
108+
splendor: splendour
109+
standardize: standardise
110+
standardized: standardised
111+
sulfur: sulphur
112+
theater: theatre
113+
traveled: travelled
114+
traveler: traveller
115+
traveling: travelling
116+
unshakable: unshakeable
117+
willful: wilful
118+
yogurt: yoghurt
119+
authorizer: authoriser

.github/styles/custom/dashes.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Don't put a space before or after a dash."
3+
link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#dashes"
4+
nonword: true
5+
level: warning
6+
action:
7+
name: edit
8+
params:
9+
- remove
10+
- " "
11+
tokens:
12+
- '\s[—–]\s'

.github/styles/custom/endash.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: existence
2+
message: "Avoid en dashes ('–'). For hyphenated words, use a hyphen ('-').\nFor
3+
parenthesis, use an em dash ('—')."
4+
link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#dashes"
5+
nonword: true
6+
level: error
7+
action:
8+
name: edit
9+
params:
10+
- replace
11+
- "-"
12+
- ""
13+
tokens:
14+
- ""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
extends: substitution
3+
message: Use '%s' instead of '%s.'
4+
level: error
5+
ignorecase: true
6+
swap:
7+
aren't: are not,
8+
can't: cannot,
9+
couldn't: could not,
10+
didn't: did not,
11+
doesn't: does not,
12+
don't: do not,
13+
hasn't: has not,
14+
haven't: have not,
15+
how'll: how will,
16+
how's: how is,
17+
isn't: is not,
18+
it'll: it will,
19+
it's: it is,
20+
shouldn't: should not
21+
that'll: that will,
22+
that's: that is,
23+
they'll: they will,
24+
they're: they are,
25+
wasn't: was not,
26+
we'll: we will,
27+
we're: we are,
28+
we've: we have,
29+
weren't: were not,
30+
what'll: what will,
31+
what's: what is,
32+
when'll: when will,
33+
when's: when is,
34+
where'll: where will,
35+
where's: where is,
36+
who'll: who will,
37+
who's: who is,
38+
why'll: why will,
39+
why's: why is,
40+
won't: will not,
41+
you're: you are
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Use the Oxford comma in '%s'."
3+
link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#commas"
4+
scope: sentence
5+
level: suggestion
6+
tokens:
7+
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'

.github/styles/custom/quotes.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: existence
2+
message: Use straight quotes instead of smart quotes.
3+
level: error
4+
nonword: true
5+
action:
6+
tokens:
7+
-
8+
-
9+
-
10+
-

.github/styles/custom/spaces.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Use only one space between words and sentences (not two)."
3+
link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#spaces"
4+
level: error
5+
nonword: true
6+
tokens:
7+
- '[\w.?!,\(\)\-":] {2,}[\w.?!,\(\)\-":]'

.github/workflows/linting.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,19 @@ jobs:
5959
git add .
6060
pre-commit run --all-files --color always --verbose
6161
working-directory: cookie-template/python-template
62+
63+
lint-prose:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout source
67+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
68+
69+
- name: Run Vale
70+
uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
fail_on_error: true
75+
filter_mode: nofilter
76+
reporter: github-check
77+
vale_flags: --glob='!.github/styles/*'

.vale.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
StylesPath = .github/styles
2+
3+
# https://github.com/errata-ai/packages
4+
Packages = proselint
5+
6+
[formats]
7+
qmd = md
8+
9+
[*.{md,qmd}]
10+
BasedOnStyles = proselint,\
11+
Vale
12+
13+
# Disable
14+
Vale.Spelling = false

0 commit comments

Comments
 (0)