Skip to content
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

Merged
merged 5 commits into from
Aug 5, 2024
Merged

Black autoformatting #135

merged 5 commits into from
Aug 5, 2024

Conversation

Edgar-21
Copy link
Contributor

@Edgar-21 Edgar-21 commented Aug 4, 2024

Two things.

  1. 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.
  2. An action that checks that code has been formatted such that applying 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 reference pyproject.toml, rather than including the necessary args in the yaml file.

Copy link
Member

@gonuke gonuke left a 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.

Copy link
Member

@gonuke gonuke left a 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

python -m pip install --upgrade pip
pip install black

- name: Run Black check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much nicer, thank you

Copy link
Contributor Author

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

Copy link
Member

@gonuke gonuke left a 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.

@gonuke gonuke merged commit 02e7087 into main Aug 5, 2024
3 checks passed
@Edgar-21 Edgar-21 deleted the black_autoformatting branch August 5, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants