-
Notifications
You must be signed in to change notification settings - Fork 24
42 lines (35 loc) · 1013 Bytes
/
lint.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
41
42
name: Lint
on: [workflow_call, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Get changed files
id: changed-python-files
uses: tj-actions/changed-files@v41
with:
separator: ' '
files: |
**/*.py
- name: Ruff
id: ruff
if: steps.changed-python-files.outputs.all_changed_files != '' && !cancelled()
run: |
ruff check --config=pyproject.toml .
ruff format --check --config=pyproject.toml .
- name: Isort
id: isort
if: steps.changed-python-files.outputs.all_changed_files != '' && !cancelled()
run: |
isort --check --diff --profile=black .