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]
)
| 3001 | |
| 3002 | |
| 3003 | def _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 | |
| 3033 | def _comment_narration_findings( |
no test coverage detected