Repository navigation
fix(detector): has_header_comment steps over the unit's own prototype; rejects trailing-comment tails - #8256
Merged
Merged
Conversation
…divider false positives Same /**(?!\*) and (?<!/)///(?!/) guard #8200 put on c/cpp: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. A /***** box border or //// divider is not a doc block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ount (?!\*) also rejected Magento-style '/***' docblocks (found on the golden: Mysql.php's doc count went up as their @var tags counted alone). Reject only banner shapes: /**** (2+ extra stars) and one-line '/*** x ***/' boxes. Applied to all 15 /** languages, c/cpp included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… doc blocks) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#8240 was blessed before #8245 merged, so main's goldens never had both: with jcl's positional comments, 119 jcl steps now read Has Header Comment 0 -> 1. Plus this PR's own GLTFLoader.js banner drift. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t end in C-family
On curl 39 of 48 dead_code hits were prose: '/* for offsetof() */',
'/* if a request ... (on a file) */', '/* return the position after
%time{} */'. In c/cpp/java/javascript/typescript, if/for/while must be
followed by '(' (their conditions always are); in c/cpp/java a commented
return must end in ';' or return a call directly (#7207's
'// return foo(x)'). curl: 48 -> 9 hits, both real commented-out
statements kept, the rest are commented prototypes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n's stale jcl header drift) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…; rejects trailing-comment tails From the curl hand audit (temporal-crucible#118): curl documents UNITTEST functions as comment, forward declaration, definition, and the walk stopped at the prototype's ';'; a blank line inside a /* */ block cut the block short; and the wrapped tail of a #define's trailing comment read as a header. curl C: 1,196 -> 1,223 header comments (29 gained, all the UNITTEST idiom; 2 lost, both trailing-comment tails). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…header; plus main's stale jcl drift) Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-protocol
marked this pull request as ready for review
November 11, 2026 01:42
Contributor
…x/dead-code-control-keyword-shape # Conflicts: # tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json # tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-keyword-shape # Conflicts: # tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json # tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
…ape' into fix/header-comment-misses
Owner
Author
Contributor
|
No description provided. |
Contributor
|
No description provided. |
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.
Summary
Three precision/recall fixes to
has_header_comment(#8240), from the curl hand audit in temporal-crucible#118 (comment-extraction Wave A):UNITTESTfunctions as doc comment, then forward declaration, then definition, and the walk stopped at the prototype's;. A;line is skipped only when it ends a declaration of this unit's name, within 3 lines. Another function's prototype still ends the walk./* ... */continues the block. A*/seen below with its/*not yet reached means the blank line is inside the comment./* Clear the bitset ...+ blank line +@unittest 3213 */was cut down to the one-word tail./*open (#define X (...) /* Room for ...+names. */), the block continues that comment. A closed trailing comment (} /* end of a */) does not block a real header below it.Measured
curl (pinned
04bfe8fbbf, 4,413 C functions outside tests/docs): 1,196 -> 1,223. All 31 changes were read:UNITTESTidiom with a real doc comment.proto2numunder a#define,stub_gss_set_neg_mechsunder an#ifdef ... /* MIT Kerberos 1.8+ ...).Golden: only
Has Header Commentchanges (148 values, all 0 -> 1):@internaloverload, the same shape as a C prototype), 12 LiveCode and 1 cpython (doc blocks with a blank line inside).Verification
tests/core_engine/test_detector.py: 4 new header tests (own prototype stepped over, another function's prototype is not, open trailing-comment tail rejected, closed trailing comment does not block, blank line inside the block). 330 passed withtest_galaxyscope.py,test_record_keeper.py,test_jcl_positional_comments.py.ruff_audit.py --ci: no new findings; format clean.golden-lock.sh python tests/tools/crucible_check.py --update --yes.🤖 Generated with Claude Code