forked from py4dstem/py4DSTEM
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 981 Bytes
/
ruff.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Ruff Check
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Get all commits
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: '**/*.py' # Adjust pattern for your file types
- name: Setup Python environment
uses: actions/setup-python@v3
- name: Install Ruff
run: pip install ruff
- name: Run Ruff on changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
- run: |
if [ -n "${ALL_CHANGED_FILES}" ]; then
# for file in ${ALL_CHANGED_FILES}; do
# echo "$file was changed"
# done
ruff check ${ALL_CHANGED_FILES}
else
echo "No files changed"
fi