-
Notifications
You must be signed in to change notification settings - Fork 12
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
Black autoformatting #135
Black autoformatting #135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Edgar-21 - hopefully this helps us avoid too much whitespace churn in reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found this action provided by PSF that might make life even easier
.github/workflows/black.yml
Outdated
python -m pip install --upgrade pip | ||
pip install black | ||
|
||
- name: Run Black check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the action provided by black
: https://black.readthedocs.io/en/stable/integrations/github_actions.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much nicer, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually not sure if the change I just made is exactly what you had in mind, this is all relatively mysterious to me still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating to the action - let's see if this does what we need.
Two things.
black --line-length 79 .
was run to format all python files with black, and with a line length of 79 characters, per PEP8. Black by default uses 88.black --line-length 79 .
does not result in any changes has been added. It runs on pushes, PRs, and manaully.When/if a
pyproject.toml
is authored it should include black args, and the action should be updated to referencepyproject.toml
, rather than including the necessary args in the yaml file.