Skip to content

Commit

Permalink
Merge pull request #7 from Moritz-Alexander-Kern/add-ruff-formatting
Browse files Browse the repository at this point in the history
add ruff formatting action
  • Loading branch information
Moritz-Alexander-Kern authored Apr 16, 2024
2 parents a4e601e + cb4379a commit 18d815a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ruff-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Ruff formatting

on:
# workflow_dispatch:
# schedule:
# - cron: "0 12 * * 0" # Weekly at noon UTC on Sundays
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize


jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check with Ruff
id: ruff-check
uses: chartboost/ruff-action@v1
with:
src: './elephant'
args: 'format --check'
continue-on-error: true

- name: Fix with Ruff
uses: chartboost/ruff-action@v1
if : ${{ steps.ruff-check.outcome == 'failure' }}
with:
src: './elephant'
args: 'format --verbose'

- name: Create PR
uses: peter-evans/create-pull-request@v5
with:
commit-message: ruff formatting
title: Ruff formatting
body: Reformatting code with ruff
branch: ruff-formatting

0 comments on commit 18d815a

Please sign in to comment.