Skip to content

Release detection: exclude test classes/functions from dead code count #4

Description

@zenprocess

Problem

The new release detection (from #2) correctly scans for unwired symbols at tag time, but flags test classes and test functions as "dead code." Test functions like test_rebase_branch_success and test classes like TestParseCriteria are invoked by pytest, not by application code — they're not dead.

This inflates the count significantly: v3.3.0 shows 169 "unwired symbols" but most are test functions. The actual dead application code is much smaller.

Fix

Exclude symbols matching these patterns from the dead code count:

  • Functions starting with test_
  • Classes starting with Test
  • Functions named pytest_* (pytest hooks)
  • Files under tests/ directory
  • Fixtures (@pytest.fixture)

Report test symbols separately if at all:

v3.3.0: 12 unwired application symbols, 157 new test symbols (excluded)

Evidence

From today's scan, v3.3.0 flagged: TestParseCriteria, test_bullet_items, test_skips_short_lines, TestHeuristicCompile, test_test_keyword_shell_check — all test code, all correctly invoked by pytest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions