https://github.com/rodrigogiraoserrao/python-black-check
A customisable GitHub action to check the style of Python code with black.
https://github.com/rodrigogiraoserrao/python-black-check
Last synced: 26 days ago
JSON representation
A customisable GitHub action to check the style of Python code with black.
- Host: GitHub
- URL: https://github.com/rodrigogiraoserrao/python-black-check
- Owner: rodrigogiraoserrao
- License: mit
- Created: 2020-03-28T23:41:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T18:15:16.000Z (about 1 year ago)
- Last Synced: 2025-04-24T04:14:24.724Z (26 days ago)
- Language: Dockerfile
- Size: 12.7 KB
- Stars: 13
- Watchers: 1
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-black-check
A customisable GitHub action to check the style of Python code with [black](https://github.com/psf/black).# Inputs
You can use inputs to alter how `black` will check your code.## Path (optional)
This tells `black` where to look for files to check.**Default**: `.`, i.e. looks for files in the whole repository.
## Line-length (optional)
This tells `black` how long each line of Python code can be.**Default**: `81`, which is _different_ from `black`'s default of `88`.
## Include (optional)
This tells `black` which files we should verify the format of.**Default**: `\.pyi?$`, which matches `black`'s default value.
## Exclude (optional)
This tells `black` which files we should ignore.**Default**: `/(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist)/`, which matches `black`'s default value.
# Example usage
Include this in your `.github/workflows/main.yaml`:```yaml
uses: rodrigogiraoserrao/python-black-check@master
```
or, if you want to override any of the defaults,```yaml
uses: rodrigogiraoserrao/python-black-check@master
with:
line-length: '81'
path: '.'
include: 'apps'
exclude: '(/*.html|/*.mo|/*.po|/*.png|/*.rst)'
```