Skip to content

Commit

Permalink
Ruff Fix 2 (#2778)
Browse files Browse the repository at this point in the history
* Fix ruff

* Add steps to work on push events(master)
  • Loading branch information
atharva-2001 committed Aug 9, 2024
1 parent f259e54 commit 08f6fb2
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ name: codestyle
on:
push:
branches:
- master
- "*"

pull_request_target:
branches:
- master
Expand Down Expand Up @@ -36,7 +37,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
fetch-depth: 0

- name: Checkout PR and master branch
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Download Lock File
Expand All @@ -57,11 +66,21 @@ jobs:
cache-environment: true
cache-downloads: true

- name: Show statistics
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} --) | tee ruff_stats.txt
- name: Show statistics pull request
if: github.event_name == 'pull_request_target'
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_stats.txt

- name: Show entire output pull request
if: github.event_name == 'pull_request_target'
run: ruff check --output-format=concise $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_full.txt

- name: Show statistics push
if: github.event_name == 'push'
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt

- name: Show entire output
run: ruff check --output-format=concise $(git --no-pager diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} --) | tee ruff_full.txt
- name: Show entire output push
if: github.event_name == 'push'
run: ruff check --output-format=concise . | tee ruff_full.txt

- name: Statistics output read
id: ruff_stats
Expand Down

0 comments on commit 08f6fb2

Please sign in to comment.