Skip to content

feat: docs/code quality improvements#24

Merged
tob-scott-a merged 2 commits intomainfrom
quality-improvements
Apr 23, 2026
Merged

feat: docs/code quality improvements#24
tob-scott-a merged 2 commits intomainfrom
quality-improvements

Conversation

@tob-scott-a
Copy link
Copy Markdown
Collaborator

Improved test coverage in preparation for v0.2.0.

tob-scott-a and others added 2 commits April 23, 2026 11:53
Two changes driven by the most recent CI mutation-testing report
(run 24839129246 on swift-objc-parsers), which surfaced three big
pools of surviving mutants.

Refactor — hoist `_first_child_by_type` into `parsers/_common.py`:
  Swift, Objective-C, Kotlin, and Dart parsers each shipped an
  identical private copy of this AST helper. All four now import the
  shared `first_child_by_type` from the common module, and the local
  duplicates are removed.

Tests — three targeted additions:
  1. `format_diff` (was 189 surviving mutants): 16 new assertions
     lock in every section header, line prefix, count placeholder,
     sign on positive/zero/negative deltas, truncation wording at
     >20 items, attack-surface formatting for added/removed/modified
     entrypoints, edge count line, and absence of trailing whitespace.
  2. `cli.build_parser` (was 167 surviving mutants): 27 tests in a
     new `test_cli_parser.py` assert every subcommand name, every
     flag's long/short form, every default, every action type, and
     end-to-end argparse behavior for a representative command line
     per subcommand.
  3. Detector EntrypointTag precision (Java 51, Rust 42, JS/TS 34,
     NextJS 29, and similar): 63 tests in `test_detector_tags.py`
     parametrize over every HTTP verb / annotation variant per
     framework and assert kind, trust_level, asset_value, AND
     description — the four fields every mutation to the tag could
     otherwise flip undetected.

Total: +106 tests (903 → 1009 green). Ruff/format/ty all clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tob-scott-a tob-scott-a merged commit 3ffc878 into main Apr 23, 2026
13 checks passed
@tob-scott-a tob-scott-a deleted the quality-improvements branch April 23, 2026 16:17
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.

1 participant