Skip to content

[doc] Add Vale rules for patterns the Ray Data style pass fixed by hand - #66424

Closed
dstrodtman wants to merge 2 commits into
doc-1524-data-style-perffrom
doc-1524-data-style-vale-rules
Closed

dstrodtman wants to merge 2 commits into
doc-1524-data-style-perffrom
doc-1524-data-style-vale-rules

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Vale rules to the shared Ray style for patterns that the Ray Data style pass fixed by hand, over and over, across the five PRs below it.

Stacked on #66423, the last of the five Ray Data style-pass PRs. This branch targets doc-1524-data-style-perf.

This PR adds rule files only. The Ray style is still registered for RLlib pages only, in .vale.ini, and nothing changes what Vale runs in CI. Vale on the Ray Data docs is disabled on purpose for now.

New rules

Rule Type Catches Why this type
Ray.SuchAs existence, warning "like" after a plural noun that introduces examples, such as "formats like", "methods like", and "APIs like" "like" is also a comparison ("works like a queue") and a verb ("if you'd like"), so a substitution would corrupt that prose. The rule only flags, and only after these nouns.
Ray.Brands substitution, case-sensitive HuggingFace becomes Hugging Face The literal has no other sense. The match is case-sensitive so lowercase identifiers such as huggingface_hub never match, and inline code is skipped anyway.
Ray.Capitalization existence, case-sensitive Ray Tasks, Ray Actors, Ray Objects, Ray Workers, Ray Nodes, Ray Placement Groups The style guide lowercases generic nouns that name a Ray concept. Flag only, because link text that quotes a page title can keep the title's capitals.
Ray.LeadIns existence, warning For example:, For instance:, and Here's an example fragments used as lead-ins The guide wants complete-sentence lead-ins. The right rewrite depends on the example, so the rule only flags.
Ray.Filler additions existence "under the hood", "seamlessly" Both came up repeatedly in the pass.

Each rule links to the matching section of writing-style.md.

Left out on purpose

  • Slashes between words: I/O, TCP/IP, and and/or are legitimate, and a pattern can't tell them apart.
  • Gerund task headings: some gerund H1s, such as "Loading data", are kept on purpose to match the nav titles.
  • "Ray Cluster" in Ray.Capitalization: it appears mostly in page and section titles ("Ray Clusters Overview") and in the "Ray Cluster Launcher" component name.
  • "Pandas" to "pandas": a case-sensitive swap misfires at the start of a sentence.

Verification

  • A test file with positive and negative cases, run with the real vocabularies loaded, so accept-list shadowing would show up. That check caught the APIs accept-list entry shadowing Ray.SuchAs, so the rule sets vocab: false. Every positive case fires. None of these fire:
    • "works like a queue" and "if you'd like"
    • huggingface_hub in inline code
    • "Ray Tasks" as {ref} link text
    • lowercase "Ray tasks"
  • The full Ray style, run by hand against all 25 top-level doc/source/data/*.md pages at the head of the style-pass stack, reports five warnings and none from the new rules:
  • The pre-commit hooks passed.

AI assistance

I made these changes with AI assistance (Claude Code).

🤖 Generated with Claude Code

@dstrodtman dstrodtman added the docs An issue or change related to documentation label Sep 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several new Vale style rules for the Ray project, including checks for brand capitalization (e.g., 'Hugging Face'), lowercasing generic Ray nouns, flagging filler words like 'under the hood' and 'seamlessly', requiring complete-sentence lead-ins, and preferring 'such as' over 'like' for examples. The feedback suggests expanding these rules to be more comprehensive: adding more generic nouns (like objects, clusters, workers, nodes, and placement groups) to the capitalization checks, flagging 'for instance:' as an incomplete lead-in, and including domain-specific nouns (like datasets, apis, and blocks) in the 'such as' rule.

Comment thread .vale/styles/Ray/Capitalization.yml Outdated
# legitimately keep the title's capitals, and scripts/ray_style_autofix.py would
# rewrite those blindly.
tokens:
- 'Ray (?:Tasks?|Actors?)\b'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Ray style guide also lists other generic nouns that should be lowercased even when they name a Ray concept, such as object, cluster, worker, node, and placement group. Consider extending this rule to catch capitalized versions of these as well.

  - 'Ray (?:Tasks?|Actors?|Objects?|Clusters?|Workers?|Nodes?|Placement [Gg]roups?)\b'
References
  1. Lowercase generic nouns even when they name a Ray concept: task, actor, object, cluster, worker, node, placement group. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly applied in 24405cb: added Objects, Workers, Nodes, and Placement Groups. Left out "Ray Cluster". Most of its uses in the docs are page and section titles, such as "Ray Clusters Overview", or the "Ray Cluster Launcher" component name, so flagging it would be mostly noise.

Comment thread .vale/styles/Ray/LeadIns.yml Outdated
# complete sentences that end with a colon. These fragments recur before code
# blocks. Flag only, since the right rewrite depends on what the example shows.
tokens:
- '\bfor example:'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider also flagging for instance: as an incomplete-sentence lead-in, as it is a common alternative to for example:.

  - '\bfor (?:example|instance):'
References
  1. Write list lead-ins as complete sentences, and end them with a colon. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 24405cb.

Comment thread .vale/styles/Ray/SuchAs.yml Outdated
# So this rule only flags, and only when "like" follows a plural noun that
# typically introduces a list of examples. Other uses are left to the prose pass.
tokens:
- '(?:formats|methods|functions|frameworks|libraries|services|operations|databases|tools|models) like'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since these rules are inspired by the Ray Data style pass, consider adding other common domain-specific nouns like datasets, apis, and blocks to the list of nouns checked before like.

  - '(?:formats|methods|functions|frameworks|libraries|services|operations|databases|tools|models|datasets|apis|blocks) like'
References
  1. Use 'such as,' not 'like,' for examples. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added datasets and APIs in 24405cb. Left out blocks, which never precedes an example list in the docs. Testing the APIs case also showed that the accept-list entry for APIs shadowed the rule, so Ray.SuchAs now sets vocab: false.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b6b2a0b. Configure here.

ignorecase: false
vocab: false
swap:
HuggingFace: Hugging Face

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicting Hugging Face substitutions

Low Severity

Ray.Brands swaps HuggingFace to Hugging Face, but Google.WordList already maps huggingface and Huggingface to HuggingFace at error level. Both styles run on RLlib pages, so the error-level fix is the form this new warning then rejects.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b6b2a0b. Configure here.

@dstrodtman
dstrodtman force-pushed the doc-1524-data-style-perf branch from 53fca29 to 035ef43 Compare September 23, 2026 16:03
@dstrodtman
dstrodtman requested review from a team as code owners September 23, 2026 16:03
@dstrodtman
dstrodtman force-pushed the doc-1524-data-style-vale-rules branch 2 times, most recently from 24405cb to f51c6d7 Compare September 23, 2026 17:03
dstrodtman and others added 2 commits September 23, 2026 13:09
Add four rules to the shared Ray Vale style and extend Filler, for patterns
that recurred across the Ray Data style pass:

- Ray.SuchAs flags "like" only after a plural noun that introduces examples,
  such as "formats like". It's an existence rule rather than a substitution,
  because "like" is also a comparison and a verb and a swap would corrupt
  that prose.
- Ray.Brands swaps "HuggingFace" for "Hugging Face", case-sensitively.
- Ray.Capitalization flags "Ray Tasks" and "Ray Actors" in prose.
- Ray.LeadIns flags "For example:" and "Here's an example" fragments.
- Ray.Filler adds "under the hood" and "seamlessly".

The Ray style stays registered for RLlib only. Nothing changes what Vale
runs in CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Add objects, workers, nodes, and placement groups to Ray.Capitalization, add datasets and APIs to Ray.SuchAs, and add "for instance:" to Ray.LeadIns. Set vocab: false on Ray.SuchAs, because the APIs accept-list entry shadowed the rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1524-data-style-perf branch from cc85fba to 76c2545 Compare September 23, 2026 17:10
@dstrodtman
dstrodtman force-pushed the doc-1524-data-style-vale-rules branch from f51c6d7 to 4546ffd Compare September 23, 2026 17:10
@dstrodtman

Copy link
Copy Markdown
Contributor Author

Folded into #66412. Both PRs change the Vale configuration for the Ray Data docs for the same reason, so they'll be reviewed and land together. The two commits here were cherry-picked onto #66412 unchanged.

@dstrodtman dstrodtman closed this Sep 23, 2026
dstrodtman added a commit that referenced this pull request Sep 23, 2026
… for Ray Data docs (#66412)

## Why

This PR collects the Vale configuration changes for the Ray Data docs
into one review:

- It prepares the Ray Data docs for a style and grammar pass. Vale can
then flag real problems, such as future tense, without noise from valid
terms it doesn't know.
- It adds Vale rules to the shared `Ray` style for patterns that the Ray
Data style pass fixed by hand, over and over, across the style-pass PRs
stacked above this one.

The rules were written after the style pass, so they sit lower in the
stack than the work that motivated them. They touch the same Vale
configuration for the same reason, so they're reviewed and landed
together here. The rule changes were previously in #66424, now closed.

Stacked on #66381, which is stacked on #66375 and #66352. Review and
merge those first. This branch targets `doc-1524-data-prose-softwrap`.

## What

### Vocabulary and suppressions

- Removes the two `<!-- vale off -->` / `<!-- vale on -->` blocks from
`custom-datasource-example.md`. This was the only Ray Data page that
disabled Vale. Both blocks suppressed the future-tense check, and the
style pass should fix that prose rather than hide it.
- Updates `.vale/styles/config/vocabularies/Data/accept.txt`:
- Adds `BentoML`, `CIFAR`, `[Dd]ownscal(e|es|ed|ing)`, `JPEG`,
`Kinetica`, `NVTabular`, `Petastorm`, `Psycopg`, `PyArrow`, `Tekken`,
`torchtext`, and `torchvision`.
- Changes `Datasinks?` to `[Dd]atasinks?` so lowercase "datasink" is
accepted, matching `[Dd]atasource(s)?`.
- Removes entries that duplicate other vocabularies: `docstrings`,
`NLP`, `PIL`, and `TPU(s)?` are in General, and `XGBoost` is in Train.
- Removes entries that don't appear in the prose of any `.md` or `.rst`
page under `doc/source/`: `assess_quality`, `process_file`,
`[Mm]ultiget(s)?`, `PDFs`, `Predibase('s)?`, `[Rr]eformat(s)?`, and
`[Pp]ostprocessor(s)?`.
- Renames the `ABS` tab to `Azure Blob Storage` in `loading-data.md` and
`saving-data.md`, because the acronym isn't widely known.

The remaining spelling and terms alerts are intentional. They point at
text the style pass fixes: `Bento ML`, `Sagemaker`, `Numpy`, `pyarrow`,
`underly`, `undersaturated`, and the unformatted `map_batches` and
`smart_resize` identifiers.

### New rules

These are rule files only. The `Ray` style is still registered for RLlib
pages only, in `.vale.ini`, and nothing changes what Vale runs in CI.
Vale on the Ray Data docs is disabled on purpose for now.

| Rule | Type | Catches | Why this type |
|---|---|---|---|
| `Ray.SuchAs` | existence, warning | "like" after a plural noun that
introduces examples, such as "formats like", "methods like", and "APIs
like" | "like" is also a comparison ("works like a queue") and a verb
("if you'd like"), so a substitution would corrupt that prose. The rule
only flags, and only after these nouns. |
| `Ray.Brands` | substitution, case-sensitive | `HuggingFace` becomes
`Hugging Face` | The literal has no other sense. The match is
case-sensitive so lowercase identifiers such as `huggingface_hub` never
match, and inline code is skipped anyway. |
| `Ray.Capitalization` | existence, case-sensitive | `Ray Tasks`, `Ray
Actors`, `Ray Objects`, `Ray Workers`, `Ray Nodes`, `Ray Placement
Groups` | The style guide lowercases generic nouns that name a Ray
concept. Flag only, because link text that quotes a page title can keep
the title's capitals. |
| `Ray.LeadIns` | existence, warning | `For example:`, `For instance:`,
and `Here's an example` fragments used as lead-ins | The guide wants
complete-sentence lead-ins. The right rewrite depends on the example, so
the rule only flags. |
| `Ray.Filler` additions | existence | "under the hood", "seamlessly" |
Both came up repeatedly in the pass. |

Each rule links to the matching section of `writing-style.md`.

Left out on purpose:

- **Slashes between words:** `I/O`, `TCP/IP`, and `and/or` are
legitimate, and a pattern can't tell them apart.
- **Gerund task headings:** some gerund H1s, such as "Loading data", are
kept on purpose to match the nav titles.
- **"Ray Cluster" in `Ray.Capitalization`:** it appears mostly in page
and section titles ("Ray Clusters Overview") and in the "Ray Cluster
Launcher" component name.
- **"Pandas" to "pandas":** a case-sensitive swap misfires at the start
of a sentence.

## Verification

Vocabulary: `vale doc/source/data` with Vale 3.12: `Vale.Spelling` drops
from 26 to 10 alerts, `Google.Acronyms` from 4 to 0, and the remaining
`Vale.Spelling` and `Vale.Terms` alerts are all in the list above.
`custom-datasource-example.md` now reports its three `Google.Will`
alerts.

Rules:

- A test file with positive and negative cases, run with the real
vocabularies loaded, so accept-list shadowing would show up. That check
caught the `APIs` accept-list entry shadowing `Ray.SuchAs`, so the rule
sets `vocab: false`. Every positive case fires. None of these fire:
  - "works like a queue" and "if you'd like"
  - `huggingface_hub` in inline code
  - "Ray Tasks" as `{ref}` link text
  - lowercase "Ray tasks"
- The full `Ray` style, run by hand against all 25 top-level
`doc/source/data/*.md` pages at the head of the style-pass stack,
reports five warnings and none from the new rules:
- "For now" in `mixing-data.md` and "Currently" in `performance-tips.md`
are temporary-limitation signals that the stack keeps on purpose.
- "seamlessly" in `comparisons.md` and "very" twice in
`shuffling-data.md` were filler that the pass missed. They're now fixed
in #66413 and #66420, the style PRs for those pages.
- That run was at the head of the style-pass stack, not at this branch.
Running the `Ray` style by hand against the Data pages here might report
matches that the stack above fixes. That doesn't affect CI, since the
`Ray` style isn't registered for Data pages.

The Vale pre-commit hook is still commented out, so this doesn't change
CI.

## AI assistance

I made these changes with AI assistance (Claude Code).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
… for Ray Data docs (ray-project#66412)

## Why

This PR collects the Vale configuration changes for the Ray Data docs
into one review:

- It prepares the Ray Data docs for a style and grammar pass. Vale can
then flag real problems, such as future tense, without noise from valid
terms it doesn't know.
- It adds Vale rules to the shared `Ray` style for patterns that the Ray
Data style pass fixed by hand, over and over, across the style-pass PRs
stacked above this one.

The rules were written after the style pass, so they sit lower in the
stack than the work that motivated them. They touch the same Vale
configuration for the same reason, so they're reviewed and landed
together here. The rule changes were previously in ray-project#66424, now closed.

Stacked on ray-project#66381, which is stacked on ray-project#66375 and ray-project#66352. Review and
merge those first. This branch targets `doc-1524-data-prose-softwrap`.

## What

### Vocabulary and suppressions

- Removes the two `<!-- vale off -->` / `<!-- vale on -->` blocks from
`custom-datasource-example.md`. This was the only Ray Data page that
disabled Vale. Both blocks suppressed the future-tense check, and the
style pass should fix that prose rather than hide it.
- Updates `.vale/styles/config/vocabularies/Data/accept.txt`:
- Adds `BentoML`, `CIFAR`, `[Dd]ownscal(e|es|ed|ing)`, `JPEG`,
`Kinetica`, `NVTabular`, `Petastorm`, `Psycopg`, `PyArrow`, `Tekken`,
`torchtext`, and `torchvision`.
- Changes `Datasinks?` to `[Dd]atasinks?` so lowercase "datasink" is
accepted, matching `[Dd]atasource(s)?`.
- Removes entries that duplicate other vocabularies: `docstrings`,
`NLP`, `PIL`, and `TPU(s)?` are in General, and `XGBoost` is in Train.
- Removes entries that don't appear in the prose of any `.md` or `.rst`
page under `doc/source/`: `assess_quality`, `process_file`,
`[Mm]ultiget(s)?`, `PDFs`, `Predibase('s)?`, `[Rr]eformat(s)?`, and
`[Pp]ostprocessor(s)?`.
- Renames the `ABS` tab to `Azure Blob Storage` in `loading-data.md` and
`saving-data.md`, because the acronym isn't widely known.

The remaining spelling and terms alerts are intentional. They point at
text the style pass fixes: `Bento ML`, `Sagemaker`, `Numpy`, `pyarrow`,
`underly`, `undersaturated`, and the unformatted `map_batches` and
`smart_resize` identifiers.

### New rules

These are rule files only. The `Ray` style is still registered for RLlib
pages only, in `.vale.ini`, and nothing changes what Vale runs in CI.
Vale on the Ray Data docs is disabled on purpose for now.

| Rule | Type | Catches | Why this type |
|---|---|---|---|
| `Ray.SuchAs` | existence, warning | "like" after a plural noun that
introduces examples, such as "formats like", "methods like", and "APIs
like" | "like" is also a comparison ("works like a queue") and a verb
("if you'd like"), so a substitution would corrupt that prose. The rule
only flags, and only after these nouns. |
| `Ray.Brands` | substitution, case-sensitive | `HuggingFace` becomes
`Hugging Face` | The literal has no other sense. The match is
case-sensitive so lowercase identifiers such as `huggingface_hub` never
match, and inline code is skipped anyway. |
| `Ray.Capitalization` | existence, case-sensitive | `Ray Tasks`, `Ray
Actors`, `Ray Objects`, `Ray Workers`, `Ray Nodes`, `Ray Placement
Groups` | The style guide lowercases generic nouns that name a Ray
concept. Flag only, because link text that quotes a page title can keep
the title's capitals. |
| `Ray.LeadIns` | existence, warning | `For example:`, `For instance:`,
and `Here's an example` fragments used as lead-ins | The guide wants
complete-sentence lead-ins. The right rewrite depends on the example, so
the rule only flags. |
| `Ray.Filler` additions | existence | "under the hood", "seamlessly" |
Both came up repeatedly in the pass. |

Each rule links to the matching section of `writing-style.md`.

Left out on purpose:

- **Slashes between words:** `I/O`, `TCP/IP`, and `and/or` are
legitimate, and a pattern can't tell them apart.
- **Gerund task headings:** some gerund H1s, such as "Loading data", are
kept on purpose to match the nav titles.
- **"Ray Cluster" in `Ray.Capitalization`:** it appears mostly in page
and section titles ("Ray Clusters Overview") and in the "Ray Cluster
Launcher" component name.
- **"Pandas" to "pandas":** a case-sensitive swap misfires at the start
of a sentence.

## Verification

Vocabulary: `vale doc/source/data` with Vale 3.12: `Vale.Spelling` drops
from 26 to 10 alerts, `Google.Acronyms` from 4 to 0, and the remaining
`Vale.Spelling` and `Vale.Terms` alerts are all in the list above.
`custom-datasource-example.md` now reports its three `Google.Will`
alerts.

Rules:

- A test file with positive and negative cases, run with the real
vocabularies loaded, so accept-list shadowing would show up. That check
caught the `APIs` accept-list entry shadowing `Ray.SuchAs`, so the rule
sets `vocab: false`. Every positive case fires. None of these fire:
  - "works like a queue" and "if you'd like"
  - `huggingface_hub` in inline code
  - "Ray Tasks" as `{ref}` link text
  - lowercase "Ray tasks"
- The full `Ray` style, run by hand against all 25 top-level
`doc/source/data/*.md` pages at the head of the style-pass stack,
reports five warnings and none from the new rules:
- "For now" in `mixing-data.md` and "Currently" in `performance-tips.md`
are temporary-limitation signals that the stack keeps on purpose.
- "seamlessly" in `comparisons.md` and "very" twice in
`shuffling-data.md` were filler that the pass missed. They're now fixed
in ray-project#66413 and ray-project#66420, the style PRs for those pages.
- That run was at the head of the style-pass stack, not at this branch.
Running the `Ray` style by hand against the Data pages here might report
matches that the stack above fixes. That doesn't affect CI, since the
`Ray` style isn't registered for Data pages.

The Vale pre-commit hook is still commented out, so this doesn't change
CI.

## AI assistance

I made these changes with AI assistance (Claude Code).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant