Skip to content

Format and Commit Code #14

Format and Commit Code

Format and Commit Code #14

Workflow file for this run

name: Format and Commit Code
on:
workflow_run:
workflows:
- "Run Tests"
types:
- completed
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Remove unused imports/variables with autoflake
run: |
pip install autoflake
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive ./src
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive ./tests
- name: Sort imports with isort
run: |
pip install isort
isort ./src
isort ./tests
- name: Format code with black
run: |
pip install black
black ./src
black ./tests
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
author_name: ${{ github.actor }}
author_email: ${{ github.actor }}@users.noreply.github.com
message: "Format code with autoflake-isort-black"
add: "."