Skip to content

[ci] Scope code lint off doc/source code and config, split out pre_commit - #66740

Merged
dstrodtman merged 1 commit into
masterfrom
djs-261005-doc-lint-rules
Oct 5, 2026
Merged

dstrodtman merged 1 commit into
masterfrom
djs-261005-doc-lint-rules

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Description

Narrows which pull requests run the code-oriented lint matrix in .buildkite/lint.rayci.yml. It doesn't change anything that runs on master or release branches, which bypass rule evaluation.

doc/source/*.py, *.yaml, and *.yml no longer emit lint. .pre-commit-config.yaml excludes doc/source/ globally, apart from data prose and BUILD files, so pre_commit and pre-commit pydoclint never see these files, even with --all-files. None of the other checks read them either:

  • clang_format and copyright_format read only C++.
  • dashboard_format reads only the dashboard client.
  • bazel_buildifier reads only BUILD and .bzl files.
  • bazel_team, pytest_format, and test_coverage query test targets under python/.

Before this change, editing doc/source/conf.py ran all nine code checks, roughly 6 to 8 minutes of runner time each, and none of them could fail on it. test.rules.txt is unchanged, so these paths still emit doc and the library doc tags, and doctests and the doc build still run.

pre_commit now has its own step. It moves out of the lint-small matrix into a lint-pre-commit step tagged lint and pre_commit. Its trailing-whitespace and end-of-file hooks do read .vale.ini, .vale/, and doc/redirects/*.yaml. Those paths now emit always pre_commit, so they run pre_commit without the other seven checks. Anything that emits lint still selects the step, so code PRs are unaffected.

This also corrects the comment in always.rules.txt and the expectation in always.rules.test.txt that both said pre_commit lints doc/source/*.py.

Related issues

None. I searched open PRs that touch always.rules.txt or the lint tags and found nothing in flight. The most recent related change is #65431, which scoped doc_readme the same way.

Additional information

Verification

  • rayci test-rules at the pinned .rayciversion (0.48.0): all expectations pass. As a negative control, I reverted one new expectation and confirmed it fails.
  • I ran pre-commit run trailing-whitespace --files … on each path to confirm pre-commit's file scope. doc/source/conf.py, doc/source/cluster/kubernetes/configs/loki.log.yaml, and doc/source/data/examples.yml report "Skipped". .vale.ini, .vale/styles/Google/AMPM.yml, and doc/redirects/current.yaml are checked.
  • I ran a tag dry-run on single-file diffs. The lint steps each one selects:
Changed file Emitted tags Lint steps selected
doc/source/conf.py always doc doc_api always-tagged steps only
.vale.ini always doc pre_commit always steps + lint: pre_commit
doc/redirects/current.yaml always doc_redirects pre_commit always steps + lint: pre_commit
python/ray/actor.py always lint … Full matrix, unchanged
doc/source/index.md always always steps only, unchanged

This draft PR is the confirming check that the emitted pipeline matches the table.

Out of scope: notebooks under doc/source/ are hidden by the same pre-commit exclude, but they stay on the catch-all for now. If that exclude ever narrows to cover doc/source/*.py, the new rule should be removed. The comment in always.rules.txt says so.

AI assistance (Claude Code) was used to investigate and draft this change. I reviewed every changed line.

🤖 Generated with Claude Code

…mmit

doc/source/*.py, *.yaml, and *.yml no longer select the code-oriented
lint matrix. .pre-commit-config.yaml excludes doc/source/ globally, so
pre_commit and pydoclint never see these files, and no other lint check
reads them.

pre_commit moves out of the lint-small matrix into its own step with an
extra pre_commit tag. .vale.ini, .vale/, and doc/redirects/*.yaml emit
that tag, so they run pre_commit, whose whitespace hooks can fail on
them, without the rest of the matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 5, 2026
@dstrodtman
dstrodtman marked this pull request as ready for review October 5, 2026 17:10
@dstrodtman
dstrodtman requested a review from a team as a code owner October 5, 2026 17:10

@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 optimizes the Buildkite CI pipeline by separating the pre_commit lint step from the main lint matrix and refining the trigger rules for documentation and configuration files. Specifically, Python and YAML files under doc/source/ are exempted from the full lint matrix since they are already excluded globally by pre-commit, while configuration files (like Vale and redirects) now trigger only the pre_commit step instead of the entire lint suite. There are no review comments, so I have no feedback to provide.

@dstrodtman
dstrodtman merged commit 237db3e into master Oct 5, 2026
6 checks passed
@dstrodtman
dstrodtman deleted the djs-261005-doc-lint-rules branch October 5, 2026 18:18
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…mmit (ray-project#66740)

## Description

Narrows which pull requests run the code-oriented lint matrix in
`.buildkite/lint.rayci.yml`. It doesn't change anything that runs on
master or release branches, which bypass rule evaluation.

**`doc/source/*.py`, `*.yaml`, and `*.yml` no longer emit `lint`.**
`.pre-commit-config.yaml` excludes `doc/source/` globally, apart from
data prose and BUILD files, so `pre_commit` and `pre-commit pydoclint`
never see these files, even with `--all-files`. None of the other checks
read them either:

- `clang_format` and `copyright_format` read only C++.
- `dashboard_format` reads only the dashboard client.
- `bazel_buildifier` reads only BUILD and `.bzl` files.
- `bazel_team`, `pytest_format`, and `test_coverage` query test targets
under `python/`.

Before this change, editing `doc/source/conf.py` ran all nine code
checks, roughly 6 to 8 minutes of runner time each, and none of them
could fail on it. `test.rules.txt` is unchanged, so these paths still
emit `doc` and the library doc tags, and doctests and the doc build
still run.

**`pre_commit` now has its own step.** It moves out of the `lint-small`
matrix into a `lint-pre-commit` step tagged `lint` and `pre_commit`. Its
trailing-whitespace and end-of-file hooks do read `.vale.ini`, `.vale/`,
and `doc/redirects/*.yaml`. Those paths now emit `always pre_commit`, so
they run `pre_commit` without the other seven checks. Anything that
emits `lint` still selects the step, so code PRs are unaffected.

This also corrects the comment in `always.rules.txt` and the expectation
in `always.rules.test.txt` that both said `pre_commit` lints
`doc/source/*.py`.

## Related issues

None. I searched open PRs that touch `always.rules.txt` or the lint tags
and found nothing in flight. The most recent related change is ray-project#65431,
which scoped `doc_readme` the same way.

## Additional information

**Verification**

- `rayci test-rules` at the pinned `.rayciversion` (0.48.0): all
expectations pass. As a negative control, I reverted one new expectation
and confirmed it fails.
- I ran `pre-commit run trailing-whitespace --files …` on each path to
confirm pre-commit's file scope. `doc/source/conf.py`,
`doc/source/cluster/kubernetes/configs/loki.log.yaml`, and
`doc/source/data/examples.yml` report "Skipped". `.vale.ini`,
`.vale/styles/Google/AMPM.yml`, and `doc/redirects/current.yaml` are
checked.
- I ran a tag dry-run on single-file diffs. The lint steps each one
selects:

| Changed file | Emitted tags | Lint steps selected |
|---|---|---|
| `doc/source/conf.py` | `always doc doc_api` | `always`-tagged steps
only |
| `.vale.ini` | `always doc pre_commit` | `always` steps + `lint:
pre_commit` |
| `doc/redirects/current.yaml` | `always doc_redirects pre_commit` |
`always` steps + `lint: pre_commit` |
| `python/ray/actor.py` | `always lint …` | Full matrix, unchanged |
| `doc/source/index.md` | `always` | `always` steps only, unchanged |

This draft PR is the confirming check that the emitted pipeline matches
the table.

**Out of scope:** notebooks under `doc/source/` are hidden by the same
pre-commit exclude, but they stay on the catch-all for now. If that
exclude ever narrows to cover `doc/source/*.py`, the new rule should be
removed. The comment in `always.rules.txt` says so.

AI assistance (Claude Code) was used to investigate and draft this
change. I reviewed every changed line.

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

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

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants