tdeboissiere / python-format-action

MIT License
3 stars 2 forks source link

python-format-action

GitHub action to apply black formatting + reorder-python-imports

Largely derived from

Example usage

Fill above file file with:

name: "PythonFormatting"

on: [push, pull_request]

jobs:
  formatting:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      # Run reorder-python-imports + black formatter
      - name: Black Code Formatter
        uses: tdeboissiere/python-format-action@master

You can then add a status in your README by adding:

![](https://github.com/ACCOUNT_NAME/REPO_NAME/workflows/PythonFormatting/badge.svg)

If the name of your workflow contains a space, e.g. Python Formatting, use %20:

![](https://github.com/ACCOUNT_NAME/REPO_NAME/workflows/Python%20Formatting/badge.svg)