-
Notifications
You must be signed in to change notification settings - Fork 271
Add module docstrings in stubgen #1252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for capturing and outputting module-level docstrings in stubgen. When generating stub files, the module's __doc__ attribute is now included at the top of the generated output if docstrings are enabled.
Key changes:
- Extracted docstring escaping logic into a separate
escape_docstr()method for reuse - Added module docstring capture during module processing
- Modified stub output generation to place module docstrings at the top of the file
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_functions_ext.pyi.ref | Added expected module docstring in test reference file |
| src/stubgen.py | Implemented module docstring capture and output functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I need some help with the CI, not exactly sure how the tests work... |
|
Is this an AI-generated PR? Can you explain the change related to |
Yes, why? I saw this feature was missing and had Claude implement it. I obviously reviewed the logic myself before spamming you with some AI slop though 😅 I did forget to set it as a draft, that was a mistake on my part.
The |
1235f9a to
4ba51fc
Compare
67ce20b to
4b4ca5e
Compare
4b4ca5e to
4f7d000
Compare
4f7d000 to
f876b57
Compare
|
Alright, the PR should now be ready for review. I also had to update the special case for |
The module doc is missing from the generated type stubs, this PR fixes that.