Skip to content

Commit

Permalink
Merge pull request #25 from SFI-Visual-Intelligence/christian/format-…
Browse files Browse the repository at this point in the history
…gh-action

Instead of formatting changes, fail the test if code needs formatting
  • Loading branch information
salomaestro authored Jan 31, 2025
2 parents 3f79234 + 4159b78 commit 60abd72
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ name: Format

on:
push:
branches:
- main
paths:
- 'utils/**'
pull_request:
branches:
- main
paths:
- 'utils/**'

Expand All @@ -30,18 +26,10 @@ jobs:
run: |
pip install ruff isort
- name: Run Ruff formatter
- name: Run Ruff check
run: |
ruff format utils/
ruff check utils/
- name: Run isort
- name: Run isort check
run: |
isort utils/
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add utils/
git commit -m "Auto-format: Applied ruff format and isort" || exit 0
git push
isort --check-only utils/

0 comments on commit 60abd72

Please sign in to comment.