-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.37 KB
/
lint.yml
File metadata and controls
61 lines (50 loc) · 1.37 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
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Lint
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install dependencies
run: |
uv venv
uv pip install -e ".[dev]"
- name: Run linting (ruff)
run: |
source .venv/bin/activate
ruff check src/ tests/
- name: Check code formatting (black)
run: |
source .venv/bin/activate
black --check src/ tests/
- name: Check import sorting (isort)
run: |
source .venv/bin/activate
isort --check-only src/ tests/
- name: Run type checking (mypy)
run: |
source .venv/bin/activate
mypy src/refdata