Skip to content

THClements/autoblack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoblack

GitHub Action that uses Black to reformat the Python code in incoming pull requests.

If all Python code in a pull request is already Blackened then this Action gives the PR a ✅ and does nothing else.

Otherwise, Blackened code is committed back to that pull request.

This means that no pull request will have passing tests until its code is Blackened and that reformatting is automatic with no pre-commit hooks, etc.

Inspired by:

tl;dr: It does not work.

After poking around a bit, it seems to be a design decision by the GitHub Actions team that the GitHub Actions bot can't push to either repo on a pull request from fork.

See this comment from @chrispat.

How can I try it out?

  1. Edit the platform_info.py file in this repo.
  2. Make a change that contains Python code which is not Blackened.
  3. Submit that change as a pull request.
  4. This Action should run and reformat the code to be Black compliant and commit that to your pull request.

.github/workflows/autoblack_push.yml .github/workflows/autoblack_pull_request.yml

In no way related to https://www.urbandictionary.com/define.php?term=autoblack

About

GitHub Action that autoformats pull requests with psf/black

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.8%
  • JavaScript 2.2%