-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (32 loc) · 1.32 KB
/
lint-python.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
40
name: Ruff
on:
push:
paths:
- '**.py' # Run if pushed commits include a change to any Python (.py) file.
- '.github/workflows/lint-python.yml' # Run if pushed commits include a change to this workflow file.
- 'pyproject.toml' # Run if project configuration file changes.
pull_request:
paths:
- '**.py' # Run if pushed commits include a change to any Python (.py) file.
- '.github/workflows/lint-python.yml' # Run if pushed commits include a change to this workflow file.
- 'pyproject.toml' # Run if project configuration file changes.
workflow_dispatch:
jobs:
ruff:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10", "3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install -U pip
pip3 install .[github-actions]
- name: Linting the code with ruff
run: |
ruff check $(git ls-files '*.py') --diff | ydiff -s