chore: stop running generated Python though black#1864
Merged
mergify[bot] merged 2 commits intomasterfrom Aug 10, 2020
Merged
Conversation
Running `black` on the generated source is slow... And generating *properly* formatted code is faster. This removes `black` invocations and instead tries to generate Python that is closer to the prescriptions of PEP8 (more specifically, closer to the output of `black`). There are some minor changes introduced by this change in the generated Python files, compared to when `black` was post-processing, which are hopefully acceptable degradations: - Some long type signatures are single-lined now where `black` would have broken them down into multiple lines. Reproducing the `black` behavior is too close to requiring a full blown python parser. - Certain lines that `black` chose not to break down into multiple lines are now split. I could not understand the mechanisms `black` uses to make it's choice and decided the broken down lines are readable enough. - Some `pass` statements used to be generated in proxies when there were no members, although there existed a synthetic member. Those statements were not sparking joy and were gently disposed of. - Alphanumerically ordered elements in piecemeal import declarations, so as to reduce the likelyhood of fake changes if the order of processing changes (resulting in a different creation/registration order). Fixes #1856
eladb
approved these changes
Aug 10, 2020
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Contributor
|
Merging (with squash)... |
Contributor
|
Thanks for working on this. Any estimate when a version will be released with the change? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
blackon the generated source is slow... And generatingproperly formatted code is faster. This removes
blackinvocationsand instead tries to generate Python that is closer to the prescriptions
of PEP8 (more specifically, closer to the output of
black).There are some minor changes introduced by this change in the generated
Python files, compared to when
blackwas post-processing, which arehopefully acceptable degradations:
blackwouldhave broken them down into multiple lines. Reproducing the
blackbehavior is too close to requiring a full blown python parser.
blackchose not to break down into multiple linesare now split. I could not understand the mechanisms
blackuses tomake it's choice and decided the broken down lines are readable
enough.
passstatements used to be generated in proxies when there wereno members, although there existed a synthetic member. Those
statements were not sparking joy and were gently disposed of.
as to reduce the likelyhood of fake changes if the order of processing
changes (resulting in a different creation/registration order).
Fixes #1856
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.