Skip to content

Commit

Permalink
added linting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Dec 29, 2023
1 parent c54424a commit e117b74
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4

- name: Check
id: lintcheck
id: formatcheck
uses: chartboost/ruff-action@v1
continue-on-error: true
with:
Expand All @@ -36,7 +36,7 @@ jobs:
args: format .

- name: Create pull request
if: steps.lintcheck.outcome != 'success'
if: steps.formatcheck.outcome != 'success'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: MIT

name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check
id: lintcheck
uses: chartboost/ruff-action@v1
continue-on-error: true
with:
args: check .

- name: Lint
uses: chartboost/ruff-action@v1
with:
args: check . --fix

- name: Create pull request
if: steps.lintcheck.outcome != 'success'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "🎨 Automated linting errors fix"
commit-message: "fixed linting errors (ruff)"
body: |
Linter errors found in: ${{ github.sha }}.
base: ${{ github.head_ref }}
branch: actions/ruff
reviewers: hitblast
delete-branch: true

0 comments on commit e117b74

Please sign in to comment.