MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _trailing_doxy_findings

Function _trailing_doxy_findings

scripts/code_verify_rules.py:3003–3030  ·  view source on GitHub ↗

Flag trailing-style doxygen `/**< ... */` member comments in headers. CLAUDE.md "Headers (.h) -- strict rule" forbids member-variable comments. Trailing `/**< description */` is the doxygen-specific form of that ban -- the underlying problem is the same: names + types are the docume

(
    src_text: str, path: Path, fence_mask: list[bool]
)

Source from the content-addressed store, hash-verified

3001
3002
3003def _trailing_doxy_findings(
3004 src_text: str, path: Path, fence_mask: list[bool]
3005) -> list[Finding]:
3006 """Flag trailing-style doxygen `/**< ... */` member comments in headers.
3007
3008 CLAUDE.md "Headers (.h) -- strict rule" forbids member-variable
3009 comments. Trailing `/**< description */` is the doxygen-specific form
3010 of that ban -- the underlying problem is the same: names + types are
3011 the documentation.
3012 """
3013 if path.suffix not in (".h", ".hpp", ".hxx"):
3014 return []
3015 if _is_vendored_path(path):
3016 return []
3017 out: list[Finding] = []
3018 for i, raw in enumerate(src_text.split("\n"), start=1):
3019 if i - 1 < len(fence_mask) and fence_mask[i - 1]:
3020 continue
3021 if _TRAILING_DOXY_RE.search(raw):
3022 out.append(
3023 Finding(
3024 i,
3025 "doc-trailing-member",
3026 "header member-variable trailing doxygen `/**< ... */` -- "
3027 'delete it (CLAUDE.md "No member-variable comments" rule)',
3028 )
3029 )
3030 return out
3031
3032
3033def _comment_narration_findings(

Callers 1

analyzeFunction · 0.85

Calls 4

_is_vendored_pathFunction · 0.85
FindingClass · 0.70
searchMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected