-
Notifications
You must be signed in to change notification settings - Fork 41
48 lines (39 loc) · 1.16 KB
/
linting.yaml
File metadata and controls
48 lines (39 loc) · 1.16 KB
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
43
44
45
46
47
48
name: Linting
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
ruff:
name: Ruff Linter & Formatter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry
run: pip install poetry
- name: Cache poetry virtualenv
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: poetry install
- name: Cache ruff
uses: actions/cache@v4
with:
path: .ruff_cache
key: ${{ runner.os }}-ruff-${{ github.ref_name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-ruff-main-${{ hashFiles('poetry.lock') }}
- name: Run ruff formatter check
run: poetry run ruff format --check .
- name: Run ruff linter
run: poetry run ruff check .