Skip to content

Implement Check doc and code matching on hat CLI#125

Merged
Doomsk merged 9 commits into
hhat-lang:mainfrom
kwyip:main
Jun 16, 2026
Merged

Implement Check doc and code matching on hat CLI#125
Doomsk merged 9 commits into
hhat-lang:mainfrom
kwyip:main

Conversation

@kwyip

@kwyip kwyip commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Pull Request: Add hat update documentation sync

Closes #111

What changed

This PR adds hat update so H-hat projects can keep docs/ in sync with src/ without doing the boring bookkeeping by hand.

  • Creates missing Markdown docs for .hat files by mirroring src/ into docs/.
  • Parses function, struct, and enum signatures from code.
  • Compares those signatures with the matching Markdown docs.
  • Updates stale or missing ### Signature sections while keeping existing documentation text.
  • Removes signature sections when the matching code item is gone.
  • As requested, also renames doc files without a source counterpart to orphan.<name>.md.
  • Fix some installation problems.

Tests added

The CLI test coverage now checks these main behaviors:

  1. mirrored src/docs/ file creation;
  2. signature match and mismatch handling;
  3. missing docs and orphan docs;
  4. generated Markdown matching the function and type examples from the issue.

Tests Mirrored Update Demo

hhat_lang_demo_3.mp4

Notes

I also tightened the CI/pre-commit setup.

Generative AI/LLM disclosure

Code and Logic Architecture/Design:

  • The code and logic architecture/design contain no generative AI/LLM
  • The code and logic architecture/design are partially performed by generative AI/LLM
    • 99% performed by the author(s)
  • The code and logic architecture/design are fully performed by generative AI/LLM

Code content:

  • The code contains no generative AI/LLM work
  • The code is partially written by generative AI/L
    • 69% performed by the author(s)
  • The code is fully written by generative AI/LLM

Code review:

  • The code review contains no generative AI/LLM
  • The code review is partially done by generative AI/LLM
    • X% performed by the author(s)
  • The code review is fully done by generative AI/LLM

Code tests:

  • The code tests contain no generative AI/LLM
  • The code tests are partially written by generative AI/LLM
    • X% performed by the author(s)
  • The code tests are fully written by generative AI/LLM

@Doomsk

Doomsk commented Jun 5, 2026

Copy link
Copy Markdown
Member

Hi @kwyip thank you for this PR. Is there anything you want to do or to comment before I start the review?

@kwyip

kwyip commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@Doomsk Sorry for the late reply. I don't. Please go ahead with the review. Thanks.

@Doomsk
Doomsk self-requested a review June 7, 2026 20:57
@Doomsk

Doomsk commented Jun 7, 2026

Copy link
Copy Markdown
Member

Thank you @kwyip I am starting the review.

@Doomsk Doomsk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kwyip for the work!
I will now proceed with some tests before giving the green light.

Comment thread python/src/hhat_lang/toolchain/project/update.py Outdated
@Doomsk

Doomsk commented Jun 8, 2026

Copy link
Copy Markdown
Member

before re-running the workflow actions, I will phase out the Python code that is not necessary for mkdocs and the CLI. Then you can pull the main branch into your main and check the formatting with pre-commit run --all-files

@kwyip

kwyip commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

before re-running the workflow actions, I will phase out the Python code that is not necessary for mkdocs and the CLI. Then you can pull the main branch into your main and check the formatting with pre-commit run --all-files

Hi,
Sorry for late reply. I have updated my main branch with your changes, and they should also pass pre-commit and pytest. Thanks.

@Doomsk Doomsk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kwyip. A few more changes and it can have a final review.

Comment thread python/src/hhat_lang/dialects/heather/grammar/doc_signatures.py Outdated
Comment thread python/src/hhat_lang/dialects/heather/grammar/doc_signatures.py Outdated
@kwyip
kwyip requested a review from Doomsk June 12, 2026 16:08

@Doomsk Doomsk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the minor fix, it's go to be approved @kwyip

Comment thread python/src/hhat_lang/dialects/heather/grammar/comment_grammar.py Outdated
@Doomsk

Doomsk commented Jun 15, 2026

Copy link
Copy Markdown
Member

@kwyip make sure you have verified signature for the commit to be verified and thus properly merged

@kwyip

kwyip commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@kwyip make sure you have verified signature for the commit to be verified and thus properly merged

@Doomsk Thanks for the suggestion. I have added it.

@Doomsk Doomsk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kwyip I'll proceed with the merge now

@Doomsk
Doomsk merged commit 7078744 into hhat-lang:main Jun 16, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in H-hat lang kanban Jun 16, 2026
@Doomsk

Doomsk commented Jun 16, 2026

Copy link
Copy Markdown
Member

@kwyip please comment on the issue so I can assign it to you and you can receive the bounty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[IMPL] Check doc and code matching on hat CLI

2 participants