[kimi-generated] Pre-commit and pre-push hooks fail on main due to 256 ModuleNotFoundErrors #687

Closed
opened 2026-03-21 03:26:41 +00:00 by kimi · 1 comment
Collaborator

Bug

The .githooks/pre-commit and .githooks/pre-push hooks both fail on a clean main checkout because tox -e unit (and tox -e pre-push) exit with code 1 due to 256 pre-existing ModuleNotFoundError collection errors in pytest.

All 1889 actual tests pass, but pytest returns exit code 1 when there are collection errors, which causes the hooks to block all local commits and pushes.

Steps to reproduce

  1. git checkout main
  2. tox -e unit
  3. Observe: 1889 passed, 256 errors, exit code 1

Impact

No local commits or pushes can be made without overriding the hooks path. All recent commits on main were merged via the Gitea UI (PR merges), bypassing local hooks.

Suggested fix

Either:

  • Fix the 256 missing module imports so collection succeeds
  • Or adjust the hook to tolerate collection errors when all collected tests pass (e.g., use --ignore-glob patterns for problematic test files)
## Bug The `.githooks/pre-commit` and `.githooks/pre-push` hooks both fail on a clean `main` checkout because `tox -e unit` (and `tox -e pre-push`) exit with code 1 due to 256 pre-existing `ModuleNotFoundError` collection errors in pytest. All 1889 actual tests pass, but pytest returns exit code 1 when there are collection errors, which causes the hooks to block all local commits and pushes. ### Steps to reproduce 1. `git checkout main` 2. `tox -e unit` 3. Observe: 1889 passed, 256 errors, exit code 1 ### Impact No local commits or pushes can be made without overriding the hooks path. All recent commits on main were merged via the Gitea UI (PR merges), bypassing local hooks. ### Suggested fix Either: - Fix the 256 missing module imports so collection succeeds - Or adjust the hook to tolerate collection errors when all collected tests pass (e.g., use `--ignore-glob` patterns for problematic test files)
kimi was assigned by Timmy 2026-03-21 18:02:17 +00:00
kimi added this to the Infrastructure milestone 2026-03-21 20:25:08 +00:00
Owner

Verified on main: tox -e unit runs clean — 2883 passed, 0 collection errors, exit code 0. The 256 ModuleNotFoundErrors have been resolved (likely fixed incrementally across recent PRs). Pre-commit and pre-push hooks should now work correctly. Closing.

Verified on main: `tox -e unit` runs clean — 2883 passed, 0 collection errors, exit code 0. The 256 ModuleNotFoundErrors have been resolved (likely fixed incrementally across recent PRs). Pre-commit and pre-push hooks should now work correctly. Closing.
Timmy closed this issue 2026-03-22 01:43:10 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#687