-
Notifications
You must be signed in to change notification settings - Fork 31
Add support for extra imports #342
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
Conversation
|
All changed packages have been documented.
|
commit: |
|
Can we add a separate prop for futures? Source file headers are a specific thing (a comment at the top usually with copyright info). |
@bterlson Ok, I made header to behave like header, and then introduced futureImports prop. |
There are certain scenarios in Python where we need to add imports at the top of the file without them necessarily being triggered by a symbol being referenced. One example is
from __future__ import annotations.To allow that, we are adding the
futureImportsprop, which already existed and wasn't being used.Also, we are making the module docstring to be rendered at the top, as well as properly formatting the header and headerComment.
Finally, we are fixing some spacing-related situations to better adhere to PEP8.
With those changes, this is how a rendered file would look: