[py] proof of concept; formatting python code with black
.
#10560
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.
Hi, a quick proof of concept I'd like to discuss using something like black (https://github.com/psf/black) to apply to our python codebase. This is a naive implementation, consider this PR mainly for discussions. I think it's critical to get consistency across the python code base to make contributing as simple as possible with a clean (automatic) UX.
Ideally I'd like to get something like
pre-commit
(https://github.com/pre-commit/pre-commit) applying this stuff automatically on git pre-commit to avoid needless churn and be as as effecient as possible; formatting is only one small benefit there, we can use it to automate a whole heap of useful stuff.Thoughts?
If we feel this is beneficial I will look at implementing it properly; for now I have just did a 'quick pass' of the tooling to show what it may look like. I think the consistency is a massive plus. We can make slight adjustments to the configuration if we need, or even go with a completely different formatter but I'd like to see something alongside
flake8
. I would strongly push implementingpre-commit
with some hooks on the client side.[Do not merge this with tox/setup configuration as is; for demo purposes only]