TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

python-format-action

descriptinc / python-format-action

0 0 Language: Dockerfile License: MIT Updated: 2y ago

README

python-format-action

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

Largely derived from

Example usage

  • Create $GIT_REPO_ROOT_DIR/.github/workflows
  • Create $GIT_REPO_ROOT_DIR/.github/workflows/main.yml

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)

0 AIs selected
Clear selection
#
Name
Task