Skip to content

Fix ty truthiness-test-of-none-union failures in bcbench-core - #947

Merged
Sun Haoran (haoranpb) merged 1 commit into
mainfrom
fix/pre-commit-ty-lock
Oct 8, 2026
Merged

Sun Haoran (haoranpb) merged 1 commit into
mainfrom
fix/pre-commit-ty-lock

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Pre-commit started failing because uv check --package bcbench-core ran a floating ty (0.0.85) instead of the locked 0.0.84, and 0.0.85 flags truthiness-test-of-none-union in bcbench-core.

What

Python-only fixes for those failures in bc.py and logs.py (plus tests). No pre-commit or workspace config changes; the root cause (unpinned ty) is addressed at the top of the stack in #956.

Part of the stack that makes ty strict (all = "error") across the whole uv workspace. Each PR fixes one rule in Python code only; the config change lands in #956.

@github-code-quality

github-code-quality Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest

The overall line coverage in commit 084273d in the fix/pre-commit-ty-lo... branch remains at 86%, unchanged from commit d19989f in the main branch.


Updated October 07, 2026 12:58 UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 70c54f79-d7a0-4cde-baf2-e53dfff3deb4
@haoranpb
Sun Haoran (haoranpb) added this pull request to stack #957 October 7, 2026 12:57
@haoranpb Sun Haoran (haoranpb) changed the title Fix pre-commit failures and type checker drift Fix ty truthiness-test-of-none-union failures in bcbench-core Oct 7, 2026
@haoranpb
Sun Haoran (haoranpb) marked this pull request as ready for review October 7, 2026 13:12
Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:12

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The targeted fixes preserve prior semantics and are adequately covered by focused tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes new ty truthiness diagnostics in bcbench-core while preserving existing behavior.

Changes:

  • Uses explicit bool(...) checks for optional collections and logging arguments.
  • Adds tests for None and empty collections.
File Description
packages/​bcbench-core/​src/​bcbench_core/​bc.py Makes function-name truthiness explicit.
packages/​bcbench-core/​src/​bcbench_core/​logs.py Makes log argument truthiness explicit.
packages/​bcbench-core/​tests/​test_bc.py Tests absent and empty function lists.
packages/​bcbench-core/​tests/​test_logs.py Tests preservation of empty log arguments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@haoranpb
Sun Haoran (haoranpb) merged commit 60f545c into main Oct 8, 2026
18 checks passed
@haoranpb
Sun Haoran (haoranpb) deleted the fix/pre-commit-ty-lock branch October 8, 2026 09:09
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.

3 participants