Skip to content

Commit

Permalink
Add format.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacCheng9 committed Jun 25, 2024
1 parent b8e557a commit 3d916c4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Format

on: [push]

jobs:
format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12.x]

steps:
- uses: actions/checkout@v3

- name: Run Python code formatting with Ruff
uses: chartboost/ruff-action@main
with:
args: "format --exclude src/trading_portfolio_tracker/ui"

- name: Commit changes made by Ruff
uses: stefanzweifel/git-auto-commit-action@master
with:
commit_message: Format Python code with Ruff

- name: Switch to current branch
run: git checkout ${{ env.BRANCH }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

0 comments on commit 3d916c4

Please sign in to comment.