Skip to content

Commit

Permalink
add isort
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Feb 15, 2024
1 parent f0819b1 commit c83385c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/python-isort-formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python isort Formatter

on:
workflow_call:
inputs:
isort_command:
description: 'The isort command to run'
type: string
required: false
default: 'isort .'

jobs:
isort:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Sort imports
run: |
python -m pip install --upgrade pip
pip install isort
${{ github.event.inputs.isort_command }}
-
name: Remove unused imports
run: |
python -m pip install --upgrade pip
pip install autoflake
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive .
-
name: Commit changes
uses: NelsonDane/Custom-GitHub-Actions/.github/workflows/commit-to-github.yml@main
with:
message: "Auto-format with isort"

0 comments on commit c83385c

Please sign in to comment.