-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add option --privacy #517
Add option --privacy #517
Conversation
…nd implement --privacy option that allows to configure objects privacy with fnmatch.
Codecov Report
@@ Coverage Diff @@
## master #517 +/- ##
==========================================
+ Coverage 90.16% 90.21% +0.05%
==========================================
Files 35 36 +1
Lines 6507 6584 +77
Branches 1464 1484 +20
==========================================
+ Hits 5867 5940 +73
- Misses 389 392 +3
- Partials 251 252 +1
Continue to review full report at Codecov.
|
So a new import in test module made introspection test crash because of recursion error (while introspecting typing.List) :/ So to fix this I'll just do the easiest hack. |
…. It's not used for pure-python module anyway, so this hack is OK.
View example here: https://pydoctor--517.org.readthedocs.build/en/517/api/ The last readthedocs build failed because "Concurrency limit reached (2)", so that's not related with the changes. |
I feel like in order to be really helpful we should use regexes instead of fnmatch, because there are cases where it could be difficult to work with. Like if we'd like to make all top-level names in a module public, but not stuff under the top level. This would be highly impractical with the current implementation. But maybe it's good enough anyway. It satisfies the Twisted use case anyway. A new options could be added later if we feel positive about this, like What do you think. @adiroiban ? Edit: This could also be fixed by having |
I don't know what to say about At work for an I like regex, but for end users I feel that regex is on the other extreme - super powerful and complex. So, maybe just go with glob and later add some sort of git pattern matching, and further improvements. And I would say that At work, for a progressive regex support I did something like this:
So I would say , keep it simple :) Not sure if it should be called I think that the documentation should be extend to document the "standard" privacy types/classes
Not sure if Maybe it can be implemented as a What I can image, is building the apidocs in 2 versions:
I think that this is on the right direction. But before doing a full review, it would help to have the documentation, to make sure I understand the scope and target of these changes. I guess that we have 2 main use cases, and I think that these 2 examples can be part of the docs:
Thanks! |
I think what your proposing to much more complicated and users might just don't understand the --tag argument. --privacy makes it obvious we're talking about privacy teaks. I also thought of something like --override-privacy or --force-priv.
Here again, I think this kind of feature will male pydoctor more complicated to work with. I feel like #492 is a better fix for the same issue.
I will add more docs..
I've implemented and tested this, it's really not very complicated, so I'de suggest we adopt it. |
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.
I've implemented and tested this, it's really not very complicated, so I'de suggest we adopt it.
Agree.
Also, happy to keep it like --privacy
. No need for tagging.
Looking forward to do a big purge in twisted/twisted and just use standard pydoctor :)
Thanks!
… as well. Pattern added last have priority over a pattern added before.
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.
Excellent work. Only minor comments.
Thanks!
I’ve added a custom match function and rather complete documentation. Tell me what you think.
Not even sure what you are referring as tagging. The theming system is really only about templates files. Themes cannot carry custom code at this time, and probably never. But I agree the option name could be more explicit. |
Merging this, thanks @adiroiban for your reviews |
Add option
--privacy
to set the privacy of specific objects when default rules doesn't fit the use case.Finally fix #36 and #461.
Tackles part of #315.
The help:
The docs: https://pydoctor--517.org.readthedocs.build/en/517/customize.html#override-objects-privacy-show-hide