-
-
Notifications
You must be signed in to change notification settings - Fork 197
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 source code of properties #654
Conversation
I tried to reproduce the lint failures locally. But I get the error below - even with a freshly cloned pdoc. I'm using a conda environment with python 3.9, installed the dependencies with conda first and then did (3.9) thorsten@gustav:~/src/pdoc_original$ tox |
The line numbers of the @Property source don't come out right yet. formatter options need to be set as well. |
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.
Looks good! Please also add an entry in CHANGELOG.md. :)
Normally I'd insist on test coverage, but looks like we already have plenty of examples in the existing tests where this shows, so no action necessary!
In terms of workflow: Please feel free to just add more commits here, no rebasing etc. necessary. We'll squash everything into one commit in the end anyhow. :) |
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.
Awesome, thank you so much for contributing this! 😃 🍰 I thought this would be much more difficult, but you've found a fantastic workaround here.
I think, that pdoc should show the show the source code of properties.
To realize that functionality, the source code of the property function needs to be transferred to the corresponding Variable object, that is used inside the jinja2 template.
The example function bla.py is still in for testing purposes. I'll look into updating the test suite.
closes #653