SkillAgentSearch skills...

Autoblack

GitHub Action that autoformats pull requests with psf/black

Install / Use

/learn @cclauss/Autoblack
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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:

  • https://github.com/lgeiger/black-action/pull/2
  • https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests

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

View on GitHub
GitHub Stars25
CategoryDevelopment
Updated3y ago
Forks11

Languages

Python

Security Score

75/100

Audited on Dec 12, 2022

No findings