harshil21 ยท GitHub

@harshil21

Copy link Copy Markdown

Member

@Bibo-Joshi

Copy link Copy Markdown

Member

Changes look good ๐Ÿ‘ What would you think about adding a unit test for this? i.e. check for every file that's named __init__.py or doesn't have an underscore in the path (like telegram/ext/filters.py) that

  • it has __all__
  • __all__ comes directly after the docstring
  • for inits, that all non-underscore modules of that directory are included in __all__

I guess that could be done with a bit of regex. E.g. for the second one something like ^(\#[^\n]*\n)*((\"{3}[^\"]*\"{3})|)([\n ]*)__all__ could work

Not sure if this actually helps or just makes more problems ๐Ÿ˜„

@harshil21

Copy link Copy Markdown

Member Author

  • it has __all__

hm, I specifically removed __all__ for filters because iirc, it messed up with the docs (only rendered those in __all__) but maybe there's a setting for that.

  • __all__ comes directly after the docstring

actually I think this is something pylint should warn about. I'll open an issue upstream and see if they want to support it or not.

  • for inits, that all non-underscore modules of that directory are included in __all__

yes sounds reasonable.

@Bibo-Joshi

Copy link Copy Markdown

Member

  • it has __all__

hm, I specifically removed __all__ for filters because iirc, it messed up with the docs (only rendered those in __all__) but maybe there's a setting for that.

to me that sounds like __all__ was missing a lot of stuff ๐Ÿ˜ฌ

  • __all__ comes directly after the docstring

actually I think this is something pylint should warn about. I'll open an issue upstream and see if they want to support it or not.

nice idea ๐Ÿ’ช

@harshil21

Copy link Copy Markdown

Member Author

Bibo-Joshi

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

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

nice ๐Ÿ‘ about dunder names coming first: do you want to, wait for pylint, add a custom test temporarily or just merge? I'm open for all :)

@harshil21

Copy link Copy Markdown

Member Author

about dunder names coming first: do you want to, wait for pylint, add a custom test temporarily or just merge? I'm open for all :)

I think we can merge and then just update pylint dependency if they support it.

@Bibo-Joshi

@Bibo-Joshi

Bibo-Joshi pushed a commit that referenced this pull request

Dec 12, 2021

Bibo-Joshi pushed a commit that referenced this pull request

Dec 12, 2021

Read the original on github.com โ†—