./iw ./test is green on code the pre-push hook rejects #466

Closed
opened 2026-08-27 08:31:18 +00:00 by mph · 1 comment
Owner

Found triaging IW-437.

.iw/commands/test.scala runs core.test, dashboard.test and the BATS suites. It never runs scalafix. The pre-push hook does run scalafix over core/, tests included, and .scalafix.conf enables DisableSyntax with noVars.

So both ./mill core.test and ./iw ./test can be fully green on code that cannot be pushed. The phase workflow's verification step calls only those two, which means the failure surfaces at the push - the point where the least context is available and the output is worst (see #465).

OBSERVED. IW-437 phase 1 reached the push gate with two var committedBeforeMerge declarations in PhasePrHarnessTest.scala and a private var in FakeCommandEnv.scala. Every test command was green. The push was blocked.

PROPOSED FIX. Add scalafix to the ./test command so the pre-PR check matches the push gate and green means pushable.

NOTE. This is deliberately a project-level fix, not a change to any shared review guide. Lint configuration differs between projects, and var is not forbidden here in principle - it can be used where it is safe and convenient, either by rewriting or by annotating the use so scalafix accepts it. A shared guide should not carry this project's rules.

Found triaging IW-437. .iw/commands/test.scala runs core.test, dashboard.test and the BATS suites. It never runs scalafix. The pre-push hook does run scalafix over core/, tests included, and .scalafix.conf enables DisableSyntax with noVars. So both ./mill core.test and ./iw ./test can be fully green on code that cannot be pushed. The phase workflow's verification step calls only those two, which means the failure surfaces at the push - the point where the least context is available and the output is worst (see #465). OBSERVED. IW-437 phase 1 reached the push gate with two `var committedBeforeMerge` declarations in PhasePrHarnessTest.scala and a private var in FakeCommandEnv.scala. Every test command was green. The push was blocked. PROPOSED FIX. Add scalafix to the ./test command so the pre-PR check matches the push gate and green means pushable. NOTE. This is deliberately a project-level fix, not a change to any shared review guide. Lint configuration differs between projects, and `var` is not forbidden here in principle - it can be used where it is safe and convenient, either by rewriting or by annotating the use so scalafix accepts it. A shared guide should not carry this project's rules.
Author
Owner

Fixed in PR #501 (merge d1eba9c4). ./iw ./test lint runs the exact scalafix command the pre-push hook runs, and is part of the default all-run. It hard-fails when scalafix is absent rather than skipping, because a skip re-creates the false green this issue is about. Green now means pushable.

Fixed in PR #501 (merge d1eba9c4). `./iw ./test lint` runs the exact scalafix command the pre-push hook runs, and is part of the default all-run. It hard-fails when scalafix is absent rather than skipping, because a skip re-creates the false green this issue is about. Green now means pushable.
mph closed this issue 2026-09-02 20:55:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#466
No description provided.