build: migrate argument-comment-lint to a native Bazel aspect

This commit is contained in:
Michael Bolin
2026-03-28 08:27:48 -07:00
parent acd10385b4
commit d5424b571e
14 changed files with 406 additions and 271 deletions

View File

@@ -85,11 +85,11 @@ rustup toolchain install nightly-2025-09-18 \
The checked-in DotSlash file lives at `tools/argument-comment-lint/argument-comment-lint`.
`run-prebuilt-linter.py` resolves that file via `dotslash` and is the path used by
`just clippy` and `just argument-comment-lint`. Bazel-backed CI now drives the
same wrapper through package-owned test targets tagged `argument-comment-lint`.
The
source-build path remains available in `run.py` for people
iterating on the lint crate itself.
targeted package runs such as `just argument-comment-lint -p codex-core`.
Repo-wide runs now go through a native Bazel aspect that invokes a custom
`rustc_driver` and reuses Bazel-managed Rust dependency metadata instead of
spawning `cargo dylint` once per crate. The source-build path remains available
in `run.py` for people iterating on the lint crate itself.
The Unix archive layout is:
@@ -128,16 +128,17 @@ If you are changing the lint crate itself, use the source-build wrapper:
Run the lint against `codex-rs` from the repo root:
```bash
just argument-comment-lint
bazel build --config=argument-comment-lint -- //codex-rs/...
./tools/argument-comment-lint/run-prebuilt-linter.py -p codex-core
just argument-comment-lint -p codex-core
bazel test --build_tests_only --test_tag_filters=argument-comment-lint //codex-rs/...
```
If no package selection is provided, `run-prebuilt-linter.py` defaults to checking the
`codex-rs` workspace with `--workspace --no-deps`.
For non-`--fix` runs, both wrappers also default the underlying Cargo
invocation to `--all-targets` unless you explicitly narrow the target set, so
workspace and package lint runs both cover test-only call sites by default.
If no package selection is provided, `just argument-comment-lint` now defaults
to the Bazel aspect path over `//codex-rs/...`. The Python wrappers remain the
package-scoped escape hatch and still default the underlying Cargo invocation
to `--all-targets` unless you explicitly narrow the target set, so targeted
wrapper runs cover test-only call sites by default.
Repo runs also promote `uncommented_anonymous_literal_argument` to an error by
default: