Skip to content

Commit

Permalink
T6678: dif check update
Browse files Browse the repository at this point in the history
  • Loading branch information
kumvijaya authored Sep 12, 2024
1 parent 7834ca1 commit 7fb1558
Showing 1 changed file with 41 additions and 18 deletions.
59 changes: 41 additions & 18 deletions .github/workflows/ruff-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,47 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Get changed py files
id: changed-py-files
uses: tj-actions/changed-files@v44
with:
fetch_depth: 0
files: |
**.py
# - name: Get changed py files
# id: changed-py-files
# uses: tj-actions/changed-files@v44
# with:
# fetch_depth: 0
# files: |
# **.py

- name: Ruff Check
if: steps.changed-py-files.outputs.any_changed == 'true'
uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b
- name: Filter changed Python files
id: py-filter
uses: dorny/paths-filter@v3
with:
args: check
changed-files: 'true'
list-files: json
filters: |
python:
- '**/*.py'
- name: Ruff Format
if: always() && steps.changed-py-files.outputs.any_changed == 'true'
uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b
with:
args: format --diff
changed-files: 'true'
- name: Install ruff
run: |
pip install pip install ruff==0.0.47
- name: Run ruff on changed files
run: |
CHANGED_FILES=$(echo "${{ steps.py-filter.outputs.python_files }}" | jq -r '.[]')
if [ -n "$CHANGED_FILES" ]; then
ruff check --fix --diff $CHANGED_FILES
ruff format --diff $CHANGED_FILES
else
echo "No Python files changed."
fi
# - name: Ruff Check
# if: steps.changed-py-files.outputs.any_changed == 'true'
# uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b
# with:
# args: check
# changed-files: 'true'

# - name: Ruff Format
# if: always() && steps.changed-py-files.outputs.any_changed == 'true'
# uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b
# with:
# args: format --diff
# changed-files: 'true'

0 comments on commit 7fb1558

Please sign in to comment.