simonw / symbex

Find the Python code for specified symbols
Apache License 2.0
231 stars 6 forks source link

Idea: filters for private (starts with an underscore) functions and methods #38

Closed simonw closed 1 year ago

simonw commented 1 year ago

Maybe like this:

Open question: should --private return __init__ etc? Are dunder methods considered private? I think probably not.

simonw commented 1 year ago

My main use-case for this is a CI check which enforces documentation on everything except for private functions and methods:

symbex --unprivate --undocumented --check

For that example though I do think this might feel more natural:

symbex --public --undocumented --check
simonw commented 1 year ago

I think classes with a leading _ in their name _MyClass should be treated as matching the private filter too.

simonw commented 1 year ago

Docs: https://github.com/simonw/symbex/blob/ced957da0569777efdfbd12a9a828e5816c06c54/README.md?plain=1#L103-L105