-
Notifications
You must be signed in to change notification settings - Fork 432
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
Safe codegen transformations #565
Conversation
@dmitrykorolev-stripe FYI, the Python library uses Black for code formatting. Some of these changes, while safe, result in broken builds because Black would have formatted them differently. You can use |
@ob-stripe I recommend setting up an isort config that is compatible with black. See here: PyCQA/isort#694 isort mode 3 is what you want. |
@jleclanche Thanks, this is helpful! However I think the issue here is not import order (which Black doesn't seem to care about with the current configuration) but changes in the formatting of parent classes like here: https://github.com/stripe/stripe-python/pull/565/files#diff-0b7eca4f345d4708e221dcf65baa0388. Enforcing import order via Black seems like a net win though, I'll look into it. |
@ob-stripe note that black won't enforce import order on its own, but it will modify their style (eg. for long lines). isort does that too, so that is why if you use both tools you need to ensure they use a compatible mode. |
Ah gotcha, thanks for the information! |
branch: dmitrykorolev/codegen pr: #565
* Safe formatting changes from dmitry's branch branch: dmitrykorolev/codegen pr: #565 * Split some imports for better uniq'ing * Sort with basic case-sensitive algo * Reorder nested resource imports * Reorder a comment in a way that is more convenient
This went through in #573 – thanks @dmitrykorolev-stripe ! |
No description provided.