Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of formatting changes, fail the test if code needs formatting #25

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/