Skip to content

Commit

Permalink
[CI] Enforce Vale on Data documentation (ray-project#39029)
Browse files Browse the repository at this point in the history
Vale is a linter for writing style. This PR enforces Vale on the Data documentation.

Signed-off-by: Balaji Veeramani <[email protected]>
  • Loading branch information
bveeramani authored Aug 31, 2023
1 parent b248d36 commit 0fe400a
Show file tree
Hide file tree
Showing 40 changed files with 29 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .buildkite/lint.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,8 @@ steps:
- RAY_DISABLE_EXTRA_CPP=1 pip install -e python/[all]
- ./ci/lint/check_api_annotations.py
depends_on: forge

- label: ":lint-roller: lint: documentation style"
commands:
- ./ci/lint/check-documentation-style.sh
depends_on: forge
2 changes: 1 addition & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
StylesPath = .github/styles
StylesPath = .vale/styles

Vocab = General, Data

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: conditional
message: "Spell out '%s', if it's unfamiliar to the audience."
link: 'https://developers.google.com/style/abbreviations'
level: warning
level: error
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/contractions'
level: warning
level: error
ignorecase: true
action:
name: replace
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "In general, don't use an ellipsis."
link: 'https://developers.google.com/style/ellipses'
nonword: true
level: warning
level: error
action:
name: remove
tokens:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "Avoid first-person pronouns such as '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
ignorecase: true
level: warning
level: error
nonword: true
tokens:
- (?:^|\s)I\s
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "Don't put a period at the end of a heading."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
nonword: true
level: warning
level: error
scope: heading
action:
name: edit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: capitalization
message: "'%s' should use sentence-style capitalization."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
level: warning
level: error
scope: heading
match: $sentence
indicators:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ extends: existence
message: "Use the Oxford comma in '%s'."
link: 'https://developers.google.com/style/commas'
scope: sentence
level: warning
level: error
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ extends: existence
message: "Don't add words such as 'from' or 'between' to describe a range of numbers."
link: 'https://developers.google.com/style/hyphens'
nonword: true
level: warning
level: error
tokens:
- '(?:from|between)\s\d+\s?-\s?\d+'
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: existence
message: "'%s' should have one space."
link: 'https://developers.google.com/style/sentence-spacing'
level: warning
level: error
nonword: true
action:
name: remove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "In general, use American spelling instead of '%s'."
link: 'https://developers.google.com/style/spelling'
ignorecase: true
level: warning
level: error
tokens:
- '(?:\w+)nised?'
- 'colour'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: existence
message: "Try to avoid using first-person plural like '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
level: warning
level: error
ignorecase: true
tokens:
- we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: existence
message: "Avoid using '%s'."
link: 'https://developers.google.com/style/tense'
ignorecase: true
level: warning
level: error
tokens:
- will
- "'ll"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: "https://developers.google.com/style/word-list"
level: warning
level: error
ignorecase: false
action:
name: replace
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Spotify('s)?
TFRecord(s)?
UDF(s)?
[Dd]atasource
[Dd]iscretizer(s)?
[Gg]roupby
[Ii]ndexable
[Ii]ngest
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions ci/lint/check-documentation-style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -euxo pipefail

VALE_BIN=$(mktemp -d)
wget https://github.com/errata-ai/vale/releases/download/v2.28.0/vale_2.28.0_Linux_64-bit.tar.gz -P "$VALE_BIN"
tar -xvzf "$VALE_BIN"/vale_2.28.0_Linux_64-bit.tar.gz -C "$VALE_BIN" vale
"$VALE_BIN"/vale doc/source/data
rm -rf "$VALE_BIN"

0 comments on commit 0fe400a

Please sign in to comment.