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

Github Actions: autoformat with black #307

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

annabel48lin
Copy link
Contributor

@annabel48lin annabel48lin commented May 2, 2021

#295 Enforce code style with flake8 and black

  • [black] During the workflow, we now autoformat the code and push.
  • [flake8] There is also commented out code for linting with flake8, but there are currently too many errors and warnings that we need to fix, so it is not part of our workflow yet

Created issue #308: Fix errors and warnings from flake8 and add to workflow

@codecov
Copy link

codecov bot commented May 2, 2021

Codecov Report

Merging #307 (bffe1c5) into master (cc40815) will not change coverage.
The diff coverage is 81.53%.

❗ Current head bffe1c5 differs from pull request most recent head b2ce8e5. Consider uploading reports for the commit b2ce8e5 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #307   +/-   ##
=======================================
  Coverage   89.56%   89.56%           
=======================================
  Files          29       29           
  Lines        3047     3047           
=======================================
  Hits         2729     2729           
  Misses        318      318           
Impacted Files Coverage Δ
aguaclara/core/cache.py 94.28% <0.00%> (ø)
aguaclara/core/materials.py 100.00% <ø> (ø)
aguaclara/design/cdc.py 96.07% <0.00%> (ø)
aguaclara/design/plant.py 63.15% <ø> (ø)
...clara/research/environmental_processes_analysis.py 40.19% <17.07%> (ø)
aguaclara/design/component.py 42.10% <25.00%> (ø)
aguaclara/core/head_loss.py 70.33% <54.54%> (ø)
aguaclara/design/pipeline.py 71.65% <55.17%> (ø)
aguaclara/core/units.py 81.81% <60.00%> (ø)
aguaclara/design/floc.py 90.24% <66.66%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc40815...b2ce8e5. Read the comment docs.

Copy link
Member

@HannahSi HannahSi left a comment

Choose a reason for hiding this comment

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

Nice job on getting black to work! It looks like the Github Action you linked in psf's repo can be used as a third-party action, at least from a glance at the Github Actions section of the repo's readme. That could it more concise and easy to configure and less redundant. Would you be able to try that out?
Also, if you ever want to look up other actions you can check out the Github Marketplace!

# taken from https://github.com/psf/black/actions/runs/17913292/workflow
pipenv run black aguaclara
git config --global user.name 'autoblack'
git config --global user.email '[email protected]'
Copy link
Member

Choose a reason for hiding this comment

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

I think you can avoid using a personal account with a bot account like in the docs workflow. But hopefully that isn't necessary with a pre-packaged action for using black!

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