Skip to content

fix(phpt): unbreak develop after the .phpt filter merge - #3793

Closed
KuSh wants to merge 1 commit into
rtk-ai:developfrom
KuSh:fix/phpt-clippy-break
Closed

KuSh wants to merge 1 commit into
rtk-ai:developfrom
KuSh:fix/phpt-clippy-break

Conversation

@KuSh

@KuSh KuSh commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

develop does not build since 2201905 (feat(phpt): add PHP .phpt filter for php-src run-tests.php, #1503). cargo clippy --all-targets fails with 7 errors.

What broke

1. lazy_static is not a dependency.

parse() in src/cmds/php/phpt_cmd.rs declared its four regexes inside a lazy_static::lazy_static! block. The branch carried a matching Cargo.toml/Cargo.lock entry, but the manifest side did not survive the merge, so the crate is unresolved:

error[E0433]: cannot find module or crate `lazy_static` in this scope
   --> src/cmds/php/phpt_cmd.rs:162:5

…plus four E0425 cannot find value STATUS_RE / NUMBER_OF_TESTS_RE / TIME_RE / STAT_RE and one unused import: regex::Regex falling out of it.

Rather than re-add the crate, the regexes are hoisted to module-level LazyLock<Regex> statics — that's the mandated pattern in .claude/rules/rust-patterns.md and what every other filter in src/cmds/php/ already does. The patterns and the comment explaining the STATUS_RE anchoring are unchanged.

2. A RtkRule initializer that doesn't defer to DEFAULT.

The rtk phpt rule listed subcmd_savings and subcmd_status explicitly instead of closing with ..RtkRule::DEFAULT, so it missed pipeline_final_safe — a field develop added to RtkRule while the phpt branch was open:

error[E0063]: missing field `pipeline_final_safe` in initializer of `discover::rules::RtkRule`
   --> src/discover/rules.rs:581:5

Now spelled ..RtkRule::DEFAULT like its neighbours. phpt is not pipeline-final safe (only grep and rg are), and DEFAULT already carries false, so behaviour is identical to what the phpt branch intended.

Verification

cargo fmt --all && cargo clippy --all-targets && cargo test --all

Clean: zero clippy warnings, 2882 unit tests + all integration tests passing, including the phpt filter's own units, its insta snapshot, and its token-savings assertion.

No filter behaviour changes — this is a build fix only.

🤖 Generated with Claude Code

The .phpt filter landed with two build breaks that only surface once it
sits on top of develop.

`parse()` declared its regexes in a `lazy_static!` block, but lazy_static
is not a dependency of this crate — the merge kept the code and dropped
the manifest entry. RTK's rule is `LazyLock` statics anyway, so hoist the
four regexes to module level as `LazyLock<Regex>` rather than re-adding
the crate.

The `rtk phpt` discover rule spelled out `subcmd_savings`/`subcmd_status`
instead of ending in `..RtkRule::DEFAULT`, so it missed the
`pipeline_final_safe` field that develop added to `RtkRule` in the
meantime. Fall back to the default like every neighbouring rule; phpt is
not pipeline-final safe, and `false` is what DEFAULT already carries.

`cargo fmt --all && cargo clippy --all-targets && cargo test --all` is
clean again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aeppling

aeppling commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixed by #3798

Saw develop state this morning and went for a direct fix

@aeppling aeppling closed this Sep 1, 2026
@aeppling

aeppling commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thanks :)

@KuSh
KuSh deleted the fix/phpt-clippy-break branch September 1, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants