feat: docs/code quality improvements#24
Merged
tob-scott-a merged 2 commits intomainfrom Apr 23, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved test coverage in preparation for v0.2.0.