Skip to content

fix(linter): tighten Zig doc comment detection#8

Open
xen0n wants to merge 1 commit intoliyi-run:mainfrom
xen0n:feat/doc-comment-zig
Open

fix(linter): tighten Zig doc comment detection#8
xen0n wants to merge 1 commit intoliyi-run:mainfrom
xen0n:feat/doc-comment-zig

Conversation

@xen0n
Copy link
Copy Markdown
Contributor

@xen0n xen0n commented Apr 22, 2026

Summary

  • only treat the immediately preceding Zig comment as the doc comment for a declaration
  • avoid inheriting an earlier /// block across an intervening regular // comment
  • add focused Zig tests covering documented and non-documented functions and struct declarations

Root cause

  • the previous Zig detector walked backward across multiple comment siblings, so a declaration could incorrectly inherit an earlier /// doc block even when a regular // comment intervened

Testing

  • cargo test -q detect_zig_doc_comment_ -- --nocapture
  • cargo test -q tree_path::lang_zig::tests:: -- --nocapture

Only the immediately preceding Zig comment should count as a doc comment
for a declaration. Add focused tests for functions and struct declarations
covering both documented and non-documented cases.

Root cause: the previous Zig detector walked backward across multiple
comment siblings, so a declaration could incorrectly inherit an earlier
`///` doc block even when a regular `//` comment intervened.

Original prompt:

> Ah please rebase and salvage useful bits then. If nothing is useful that's
> also OK.

> okay please push and PR then

> Where's your AIGC disclosure? Check the commit convention in AGENTS.md and
> fix the PR.

AI-assisted-by: GPT-5.4 (OpenClaw)
@xen0n xen0n force-pushed the feat/doc-comment-zig branch from bd845ec to b0ae453 Compare April 23, 2026 08:31
@xen0n xen0n changed the title fix(tree_path): tighten Zig doc comment detection fix(linter): tighten Zig doc comment detection Apr 23, 2026
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