Skip to content
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

Show constructors #681

Merged
merged 14 commits into from
Apr 6, 2023
Merged

Show constructors #681

merged 14 commits into from
Apr 6, 2023

Conversation

tristanlatr
Copy link
Contributor

@tristanlatr tristanlatr commented Feb 23, 2023

This is the core of PR #656, but without the attrs support, which will come after.

Looks like this:

Capture d’écran, le 2023-02-23 à 13 22 13

Ideally we would use a presentation that could show parameters types on mouse over, but we’d need to do more work. Right now it uses the rst parser to produce the Stan. So it’s rather inflexible. But it can be improved later by directly generate Stan.

Currently it shows the constructor functions induces by init or new methods as well as class methods that uses self reference type hint as the return type.

A possible improvement would be to support inherited class method constructors if it returns the self type (whether it’s by the Self annotation or returning cls()).

Also it would be good to hide the constructors that don’t have any docstring and no arguments, because it’s the default constructor.

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Patch coverage: 94.35% and project coverage change: +0.02 🎉

Comparison is base (48be970) 92.45% compared to head (47c80f7) 92.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #681      +/-   ##
==========================================
+ Coverage   92.45%   92.47%   +0.02%     
==========================================
  Files          47       47              
  Lines        8081     8170      +89     
  Branches     1922     1948      +26     
==========================================
+ Hits         7471     7555      +84     
- Misses        355      358       +3     
- Partials      255      257       +2     
Impacted Files Coverage Δ
pydoctor/model.py 94.56% <89.65%> (-0.39%) ⬇️
pydoctor/templatewriter/pages/__init__.py 90.69% <92.85%> (ø)
pydoctor/epydoc2stan.py 94.57% <100.00%> (+0.35%) ⬆️
pydoctor/templatewriter/pages/attributechild.py 98.21% <100.00%> (ø)
pydoctor/templatewriter/pages/functionchild.py 97.95% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tristanlatr tristanlatr requested a review from a team February 24, 2023 00:25
Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

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

LGTM, let's land it!

@tristanlatr tristanlatr merged commit da6d0d3 into master Apr 6, 2023
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.

2 participants