-
Notifications
You must be signed in to change notification settings - Fork 51
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
Wrap signatures onto several lines when function len is over a treshold #831
Draft
tristanlatr
wants to merge
32
commits into
master
Choose a base branch
from
801-signature-spans
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ill help to construct one parsed docstring from several parts.
We mimic the Signature.__str__ method for the implementation but instead of returning a str we return a ParsedDocstring, which is far more convenient. This change fixes #801: - Parameters html are divided into .sig-param spans. - When the function is long enought an extra CSS class .expand-signature is added to the parent function-signature. - The first parameter 'cls' or 'self' of (class) methods is marked with the 'undocumented' CSS class, this way it's clearly not part of the API. - Add some CSS to expand the signature of long functions when they have the focus only.
This comment has been minimized.
This comment has been minimized.
…miza a little the _colorize_signature() function.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #831 +/- ##
==========================================
+ Coverage 92.29% 92.35% +0.05%
==========================================
Files 47 47
Lines 8514 8629 +115
Branches 1695 1725 +30
==========================================
+ Hits 7858 7969 +111
- Misses 385 387 +2
- Partials 271 273 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
This comment has been minimized.
This comment has been minimized.
… docstrings they only update the local to_stan() method dynamically.
…w parsed docstrings they only update the local to_stan() method dynamically." This reverts commit eca5ced.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…class. Introduce ParsedDocstring.to_text().
…s when overloads are overwhelming... This probably requires some more tweaks but it's still better than showing everything at once.
This comment has been minimized.
This comment has been minimized.
…t try to do such things either...
This comment has been minimized.
This comment has been minimized.
Fix some cyclic imports issue as a drive-by change: model.Documentable was uncessarly runtime imported inside restructuredtext and epydoc parsers.
also remove the summary caching on the parsed docstring side, this is unnecessary because it's already cahed in the documentable.
This comment has been minimized.
This comment has been minimized.
…of a string. A some annotation.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…nnotation is ambiguous (pydoctor is not a checker). Get rid of ParsedDocstring.with_linker() this API did not make sens and was rather an anti-pattern. Replace that with a new parameter of colorize_pyval(is_annotation: bool). obj_reference nodes can now be created with the attribute 'is_annotation' in which case they will be resolved a little bit differently.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…o 801-signature-spans
This comment has been minimized.
This comment has been minimized.
According to pydoctor_primer, this change doesn't affect pydoctor warnings on a corpus of open source code. ✅ |
tristanlatr
changed the title
Signatures improvments
Wrap signatures onto several lines when function len is over a treshold
Nov 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes #801 as well as introduce a rather a lot of refactoring and new ParsedDocstring features.
Signature.__str__()
, which we don't need anymore because we're computing the representation ourselve.Examples: