Skip to content

Commit b16fb88

Browse files
authored
Vale updates (#21631)
* [Hyperlint] Re-add vale rules * limit reviewer more * Updates
1 parent a870e89 commit b16fb88

File tree

11 files changed

+195
-2
lines changed

11 files changed

+195
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: gitlab_base.EOLWhitespace
3+
description: |
4+
Checks that there is no useless whitespace at the end of lines.
5+
extends: existence
6+
message: "Remove whitespace characters from the end of the line."
7+
link: https://docs.gitlab.com/development/documentation/styleguide/
8+
vocab: false
9+
level: warning
10+
scope: raw
11+
raw:
12+
- ' +\n'
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 use exclamation points in text."
3+
link: "https://developers.google.com/style/exclamation-points"
4+
nonword: true
5+
level: error
6+
action:
7+
name: edit
8+
params:
9+
- trim_right
10+
- "!"
11+
tokens:
12+
- '\w+!(?:\s|$)'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: gitlab_base.HeadingLink
3+
description: |
4+
Do not include links in a heading.
5+
Headings already have self-referencing anchor links,
6+
and they're used for generating the table of contents.
7+
Adding a link will break the anchor linking behavior.
8+
extends: existence
9+
message: "Do not use links in headings."
10+
vocab: false
11+
level: error
12+
ignorecase: true
13+
nonword: true
14+
link: https://docs.gitlab.com/development/documentation/styleguide/#links
15+
scope: raw
16+
tokens:
17+
- ^#+ .*\[.+\]\(\S+\).*$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: existence
2+
message: "Don't use end punctuation in headings."
3+
link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods
4+
nonword: true
5+
level: warning
6+
scope: heading
7+
action:
8+
name: edit
9+
params:
10+
- trim_right
11+
- ".?!"
12+
tokens:
13+
- "[a-z][.?!]$"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extends: capitalization
2+
message: "'%s' should use sentence-style capitalization."
3+
link: https://docs.microsoft.com/en-us/style-guide/capitalization
4+
level: suggestion
5+
scope: heading
6+
match: $sentence
7+
indicators:
8+
- ":"
9+
exceptions:
10+
- Azure
11+
- CLI
12+
- Code
13+
- Cosmos
14+
- Docker
15+
- Emmet
16+
- I
17+
- Kubernetes
18+
- Linux
19+
- macOS
20+
- Marketplace
21+
- MongoDB
22+
- REPL
23+
- Studio
24+
- TypeScript
25+
- URLs
26+
- Visual
27+
- VS
28+
- Windows
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# Warning: cloudflare.NonStandardQuotes
3+
#
4+
# Use only standard single and double quotes, not left or right quotes.
5+
#
6+
# For a list of all options, see https://vale.sh/docs/topics/styles/
7+
extends: existence
8+
message: "Use standard single quotes or double quotes only. Do not use left or right quotes."
9+
level: warning
10+
ignorecase: true
11+
link: https://developers.cloudflare.com/style-guide/grammar/punctuation-marks-and-symbols/quotation-marks/
12+
scope: raw
13+
raw:
14+
- "[‘’“”]"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: gitlab_base.UnclearAntecedent
3+
description: |
4+
Checks for words that need a noun for clarity.
5+
extends: existence
6+
message: "Instead of '%s', try starting this sentence with a specific subject and verb."
7+
link: https://docs.gitlab.com/development/documentation/styleguide/word_list/#this-these-that-those
8+
vocab: false
9+
level: warning
10+
ignorecase: false
11+
tokens:
12+
- "That is"
13+
- "That was"
14+
- "There are"
15+
- "There were"
16+
- "These are"
17+
- "These were"
18+
- "This is"
19+
- "This was"
20+
- "Those are"
21+
- "Those were"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# Error: cloudflare.Contractions
3+
#
4+
# Do not use contractions.
5+
#
6+
# For a list of all options, see https://vale.sh/docs/topics/styles/
7+
8+
extends: substitution
9+
message: "Use '%s' instead of '%s'."
10+
link: https://developers.cloudflare.com/style-guide/grammar/parts-of-speech/contractions/
11+
level: error
12+
ignorecase: true
13+
action:
14+
name: replace
15+
swap:
16+
are not: aren't
17+
cannot: can't
18+
could not: couldn't
19+
did not: didn't
20+
do not: don't
21+
does not: doesn't
22+
has not: hasn't
23+
have not: haven't
24+
how is: how's
25+
is not: isn't
26+
27+
'it is(?!\.)': it's
28+
'it''s(?=\.)': it is
29+
30+
should not: shouldn't
31+
32+
"that is(?![.,])": that's
33+
'that''s(?=\.)': that is
34+
35+
'they are(?!\.)': they're
36+
'they''re(?=\.)': they are
37+
38+
was not: wasn't
39+
40+
'we are(?!\.)': we're
41+
'we''re(?=\.)': we are
42+
43+
'we have(?!\.)': we've
44+
'we''ve(?=\.)': we have
45+
46+
were not: weren't
47+
48+
'what is(?!\.)': what's
49+
'what''s(?=\.)': what is
50+
51+
'when is(?!\.)': when's
52+
'when''s(?=\.)': when is
53+
54+
'where is(?!\.)': where's
55+
'where''s(?=\.)': where is
56+
57+
will not: won't

.hyperlint/.vale.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
StylesPath = ../.github/styles
2+
MinAlertLevel = suggestion
3+
IgnoredScopes = code, tt, img
4+
SkippedScopes = script, style, pre, figure, code
5+
6+
[formats]
7+
yml = yaml
8+
mdx = md
9+
10+
[*]
11+
# Ignore code surrounded by plus sign, URLs, parameters defaults, and angle brackets.
12+
TokenIgnores = (<\/?[A-Z].+>), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[), (https[^\n]+\[), ([^\n]+@[^\n]+\.[^\n])
13+
14+
[*.md]
15+
BasedOnStyles = Vale, cloudflare, cloudflare-automation
16+
Vale.Spelling = NO
17+
18+
[*.yaml]
19+
BasedOnStyles = Vale, cloudflare, cloudflare-automation
20+
Vale.Spelling = NO

.hyperlint/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ reviewer:
1313
check_status_upon_review_failure: neutral
1414
enabled: true
1515
limit_num_reviews: 2
16-
limit_num_comments: 7
16+
limit_num_comments: 5

0 commit comments

Comments
 (0)