Skip to content

Commit 11cd3c0

Browse files
author
Jesse Seldess
authored
Merge pull request cockroachdb#3194 from cockroachdb/vale-linter
Add prose linter and basic rules
2 parents c037c68 + 55edebd commit 11cd3c0

File tree

8 files changed

+42
-2
lines changed

8 files changed

+42
-2
lines changed

.vale.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
StylesPath = ci/vale
2+
MinAlertLevel = suggestion
3+
4+
[*.{md,html}]
5+
BasedOnStyles = CockroachDB
6+
7+
vale.GenderBias = YES
8+
# vale.Hedging = YES
9+
vale.Redundancy = YES
10+
vale.Repetition = YES
11+
vale.Uncomparables = YES

ci/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ RUN apk add --update \
2121
zlib \
2222
zlib-dev \
2323
&& GOBIN=/usr/local/bin go get -u github.com/cockroachdb/htmltest \
24+
&& wget -O- https://github.com/errata-ai/vale/releases/download/v0.11.2/vale_0.11.2_Linux_64-bit.tar.gz | tar -xzC /usr/local/bin vale \
2425
&& pip install --upgrade awscli \
2526
&& cd /tmp/bundler && bundle install && rm -rf /tmp/bundler \
2627
&& apk --purge del \

ci/builder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

55
image=cockroachdb/docs-builder
6-
version=${COCKROACH_DOCS_BUILDER_VERSION:-20180311-222618}
6+
version=${COCKROACH_DOCS_BUILDER_VERSION:-20180529-163433}
77

88
root=$(cd "$(dirname "$0")" && pwd)
99
repo_root=$root/..

ci/pull-request

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ curl \
2929
--data "{\"body\": \"http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/$BUILD_VCS_NUMBER/\"}" \
3030
"https://api.github.com/repos/cockroachdb/docs/issues/$BUILD_BRANCH/comments"
3131

32-
# Step 4. Run htmltest, but skip checking external links to speed things up.
32+
# Step 4. Run vale, but don't fail the build if it reports errors.
33+
run vale --no-wrap v2.1 || true
34+
35+
# Step 5. Run htmltest, but skip checking external links to speed things up.
3336
run htmltest --skip-external

ci/vale/CockroachDB/Contractions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: substitution
2+
message: Use '%s' instead of '%s'
3+
ignorecase: false
4+
level: warning
5+
swap:
6+
"(?:can\'t)": cannot
7+
"(?:don\'t)": do not
8+
"(?:shouldn\'t)": should not
9+
"(?:won\'t)": will not

ci/vale/CockroachDB/HeadingsCase.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: capitalization
2+
message: "'%s' should be in sentence case"
3+
level: warning
4+
scope: heading
5+
match: $sentence
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: existence
2+
message: Do not use end punctuation (%s) in headings
3+
scope: heading
4+
level: warning
5+
raw:
6+
- '(?:[^a-zA-Z])$'

ci/vale/CockroachDB/OxfordComma.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: existence
2+
message: 'Use the Oxford comma in a list of three or more items.'
3+
level: warning
4+
tokens:
5+
- '(?:[^,]+,){1,}\s\w+\sand'

0 commit comments

Comments
 (0)