Skip to content

docs: enforce heading title case with Vale - #1668

Merged
rapids-bot[bot] merged 5 commits into
mainfrom
docs/add-vale-prose-linting
Aug 5, 2026
Merged

docs: enforce heading title case with Vale#1668
rapids-bot[bot] merged 5 commits into
mainfrom
docs/add-vale-prose-linting

Conversation

@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator

Heading capitalization has so far only been caught in human review. This adds a Vale prose-lint hook so it is checked mechanically, and fixes the existing headings that do not comply.

The rule uses Chicago style, which keeps short prepositions and conjunctions lowercase (Where to Find Examples, Working with Incumbent Solutions) — matching how these docs already read. It also catches the opposite error: existing headings such as LP Example With Data that over-capitalize.

All 22 heading fixes are case-only, so RST underline lengths and HTML anchors are unchanged.

Verification

  • vale docs/cuopt/source — 0 errors in 66 files
  • pre-commit run --all-files — all hooks pass
  • ./build.sh docs — exit 0, html + linkcheck, zero Sphinx warnings (confirms no autosectionlabel cross-reference broke)

Reviewer note

Vale's exceptions match whole words, and a single match makes Vale skip the entire heading. A too-broad entry therefore silently disables the check for every heading that mentions it. The list must stay narrow, and vale should be re-run after editing it — documented in both ci/vale/styles/cuOpt/Headings.yml and docs/cuopt/README.md.

Follow-up

A substitution rule for MILP → MIP is the natural next step, but it cannot be added until #1653 merges — main still has 21 MILP occurrences that #1653 removes, and CI runs pre-commit on all files.

Heading capitalization has only been caught by human review. Add a Vale
prose-lint hook so it is checked mechanically.

The rule uses Chicago style, which keeps short prepositions and
conjunctions lowercase ('Where to Find Examples'), matching how these
docs already read. Fixes the 22 existing headings that did not comply;
all are case-only edits, so RST underline lengths and HTML anchors are
unchanged.

Note that Vale exceptions match whole words and a single match skips the
entire heading, so the exceptions list must stay narrow. This is
documented in the rule file and docs/cuopt/README.md.

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

The exceptions list carried 19 speculative entries. Each one is a
liability rather than dead weight: Vale skips an entire heading when an
exception matches it, so an unnecessary term silently stops the rule
from checking every heading that mentions it. A leave-one-out check
showed only 7 of the 26 entries were load-bearing; drop the rest.

Add ci/utils/check_vale_rule.sh to make that failure mode loud. It
asserts the rule still flags known violations and still accepts correct
headings, and runs as a pre-commit hook whenever ci/vale/ changes, so a
weakened rule fails CI instead of passing quietly.

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
The fixtures were only ever input to the self-test; Vale needs a file to
lint, so the test has to hand it a document. Build them in a temp dir
from two lists at the top of the script rather than keeping three files
under ci/vale/tests, which keeps the expected headings next to the
assertions that use them.

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
Keep the surface minimal. The README now shows the one-line manual check
to run after editing the exceptions list instead.

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test b6d932e

@ramakrishnap-nv
ramakrishnap-nv marked this pull request as ready for review August 5, 2026 15:40
@ramakrishnap-nv
ramakrishnap-nv requested review from a team as code owners August 5, 2026 15:40
@ramakrishnap-nv
ramakrishnap-nv marked this pull request as draft August 5, 2026 15:41
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4030f3d2-0a54-42ab-bc0a-b22a9e26c5ac

📥 Commits

Reviewing files that changed from the base of the PR and between b6d932e and 750b93c.

📒 Files selected for processing (5)
  • conda/environments/all_cuda-129_arch-aarch64.yaml
  • conda/environments/all_cuda-129_arch-x86_64.yaml
  • conda/environments/all_cuda-133_arch-aarch64.yaml
  • conda/environments/all_cuda-133_arch-x86_64.yaml
  • dependencies.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • dependencies.yaml
  • conda/environments/all_cuda-133_arch-aarch64.yaml
  • conda/environments/all_cuda-129_arch-x86_64.yaml
  • conda/environments/all_cuda-133_arch-x86_64.yaml

📝 Walkthrough

Walkthrough

Vale now checks cuOpt documentation headings with a custom Chicago title-case rule. The check runs through pre-commit and uses pinned Conda dependencies. Existing documentation headings were updated to satisfy the rule.

Changes

Documentation prose linting

Layer / File(s) Summary
Vale linting foundation
.vale.ini, ci/vale/styles/cuOpt/Headings.yml, .pre-commit-config.yaml, dependencies.yaml, conda/environments/*
Added Vale configuration, heading rules, pinned dependencies, and a pre-commit hook for .rst and .md files.
Linting usage guidance
docs/cuopt/README.md
Documented the heading policy, exceptions, commands, and validation procedure.
Documentation heading normalization
docs/cuopt/source/...
Updated documentation headings to match the configured capitalization rules.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: jameslamb, iroy30

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: enforcing heading title case with Vale.
Description check ✅ Passed The description directly explains the Vale hook, heading fixes, validation results, and follow-up work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/add-vale-prose-linting

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

CI Test Summary

✅ All 31 test job(s) passed.

@ramakrishnap-nv ramakrishnap-nv added doc Improvements or additions to documentation non-breaking Introduces a non-breaking change labels Aug 5, 2026
Vale parses .rst by shelling out to docutils' rst2html. The checks
environment does not otherwise pull in docutils, so the vale hook failed
in CI with 'rst2html not found' while passing locally, where Sphinx (and
a system python3-docutils) already provide the binary.

Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator Author

/ok to test 750b93c

@cwilkinson76 cwilkinson76 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.

LGTM

@ramakrishnap-nv
ramakrishnap-nv marked this pull request as ready for review August 5, 2026 19:35
@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator Author

/merge

@rapids-bot
rapids-bot Bot merged commit 138c2f9 into main Aug 5, 2026
177 of 179 checks passed
rapids-bot Bot pushed a commit that referenced this pull request Aug 6, 2026
## Summary

Fixes three heading case errors flagged by the Vale prose linter (added in #1668) in docs that were merged in #1653 before Vale was introduced.

- `python-async-client-api.rst`: `See also` → `See Also`
- `index.rst`: `When to choose which path` → `When to Choose Which Path`
- `python-async-client.rst`: `Next steps` → `Next Steps`

These errors are currently blocking check-style on every open PR.

## Testing

Pre-commit passes on all three files.

## Docs

Heading text only — no content change.

Authors:
  - Ramakrishna Prabhu (https://github.com/ramakrishnap-nv)

Approvers:
  - Ishika Roy (https://github.com/Iroy30)

URL: #1682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants