-
Notifications
You must be signed in to change notification settings - Fork 51
52 lines (43 loc) · 1.18 KB
/
check-code-format.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
43
44
45
46
47
48
49
50
51
52
# Check DVR-Scan code lint warnings and formatting.
name: Static Analysis
on:
pull_request:
paths:
- dvr_scan/**
- tests/**
push:
paths:
- dvr_scan/**
- tests/**
env:
UV_SYSTEM_PYTHON: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v4
with:
version: "0.5.11"
python-version: "3.13"
- name: Install Dependencies
run: |
uv pip install --upgrade pip
uv pip install --upgrade yapf toml
uv pip install -r requirements_headless.txt
- name: Check Code Format (yapf)
if: ${{ hashFiles('.style.yapf') != '' }}
run: |
python -m yapf --diff --recursive dvr_scan/
python -m yapf --diff --recursive tests/
- name: Static Analysis (ruff)
if: ${{ hashFiles('.style.yapf') == '' }}
run: |
uv pip install --upgrade ruff
python -m ruff check
python -m ruff format --check