Skip to content

make 'vale' check optional locally - #1708

Open
jameslamb wants to merge 4 commits into
NVIDIA:mainfrom
jameslamb:vale-optional
Open

make 'vale' check optional locally#1708
jameslamb wants to merge 4 commits into
NVIDIA:mainfrom
jameslamb:vale-optional

Conversation

@jameslamb

@jameslamb jameslamb commented Aug 12, 2026

Copy link
Copy Markdown
Member

Description

#1668 added a new pre-commit hook that expects to be able to invoke vale (https://github.com/vale-cli/vale).

In CI, that tool's provided via the conda environment pre-commit runs in. Locally, I think it's unlikely that all contributors would have it installed (I don't).

This proposes making the vale check optional locally but requiring it in CI.

Issue

N/A

Checklist

Notes for Reviewers

Options considered

There are other ways to work around this:

  • the official pre-commit hook documented at https://docs.vale.sh/integrations/pre-commit, but that requires that you have go installed locally
  • using a language: conda hook (these are heavyweight and slow to initialize, I don't think it's worth it for a docs linter)

I think the little shell script is a good compromise.

How I tested this

Made changes I knew would trigger the linter.

In an environment without vale.

$ pre-commit run --all-files vale
Vale docs prose lint.....................................................Passed
- hook id: vale
- duration: 0s

WARNING: vale not found — skipping prose lint. Install 'vale' to run this check locally.

And again with it

$ conda create --yes --name vale-dev vale docutils
$ source activate vale-dev
$ pre-commit run --all-files vale
Vale docs prose lint.....................................................Failed
- hook id: vale
- duration: 0.66s
- exit code: 1

docs/cuopt/source/cuopt-python/quick-start.rst:15:1:cuOpt.Headings:Heading 'NVIDIA launchable' should use title case.

@jameslamb
jameslamb requested a review from a team as a code owner August 12, 2026 22:01
@jameslamb jameslamb added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 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: 7662eca9-fa1b-4f1e-80bc-820b9101d32c

📥 Commits

Reviewing files that changed from the base of the PR and between eaa61d7 and 7945bd1.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .pre-commit-config.yaml

📝 Walkthrough

Walkthrough

The PR adds a strict Vale wrapper, updates the local pre-commit hook to use it, and excludes the wrapper from four CI changed-file groups.

Changes

Vale integration

Layer / File(s) Summary
Vale wrapper and local hook
ci/run-vale.sh, .pre-commit-config.yaml
The wrapper handles missing Vale differently for local runs and CI, then forwards arguments when Vale is available. The pre-commit hook uses the wrapper with explicit options and no filename arguments.
CI changed-file exclusions
.github/workflows/pr.yaml
The workflow excludes ci/run-vale.sh from the build_docs, test_cpp, test_python_conda, and test_python_wheels changed-file groups.

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

Mergeability Score: ⚪ Minimal · up to 7945b

The change makes Vale optional for local contributors while keeping the check required in CI; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: kylefromnvidia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: making the Vale check optional for local development.
Description check ✅ Passed The description explains the local and CI behavior, implementation, rationale, alternatives, and testing for the Vale check change.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.pre-commit-config.yaml:
- Around line 140-143: Update the Vale hook configuration around entry
ci/run-vale.sh so it receives and lints the matched documentation file paths:
remove pass_filenames: false, or explicitly configure args to target
docs/cuopt/source. Preserve the existing verbose and system-language settings.

In `@ci/run-vale.sh`:
- Around line 8-17: Add unit tests covering the three branches in the Vale
wrapper: missing vale with CI unset exits successfully, missing vale with
CI=true exits unsuccessfully, and an available fake vale receives all arguments
while its exit status is preserved. Ensure tests isolate PATH and CI environment
state and do not depend on a real Vale installation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c827b05c-af5f-4ec3-b572-41628b8227b0

📥 Commits

Reviewing files that changed from the base of the PR and between 6f164ae and eaa61d7.

📒 Files selected for processing (3)
  • .github/workflows/pr.yaml
  • .pre-commit-config.yaml
  • ci/run-vale.sh

Comment thread .pre-commit-config.yaml
Comment thread ci/run-vale.sh
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

CI Test Summary

2 failed · 29 passed · 0 skipped

conda-cpp-tests / 12.2.2, 3.11, arm64, ubuntu22.04, a100, latest-driver, latest-deps — 2 failed tests
  • DefaultServerTests.DeleteQueuedJobPreventsRun
  • DefaultServerTests.DeleteRunningJobCancelsWorker
conda-cpp-tests / 12.2.2, 3.11, amd64, rockylinux8, v100, earliest-driver, oldest-deps — 2 failed tests
  • DefaultServerTests.DeleteQueuedJobPreventsRun
  • DefaultServerTests.DeleteRunningJobCancelsWorker

@jameslamb

This comment was marked as resolved.

@jameslamb
jameslamb marked this pull request as draft August 13, 2026 14:47
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 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.

@jameslamb jameslamb changed the title make 'vale' check optional locally WIP: make 'vale' check optional locally Aug 13, 2026
@jameslamb jameslamb changed the title WIP: make 'vale' check optional locally make 'vale' check optional locally Aug 13, 2026
@jameslamb
jameslamb marked this pull request as ready for review August 13, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant