Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f315a3

Browse files
committedJan 17, 2025·
github: add Static Analysis workflow
1 parent 4923f0e commit 4f315a3

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed
 

‎.github/workflows/static.yaml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
push:
3+
paths:
4+
- "ignis/**"
5+
- ".github/workflows/static.yaml"
6+
pull_request:
7+
paths:
8+
- "ignis/**"
9+
- ".github/workflows/static.yaml"
10+
11+
name: Static Analysis
12+
jobs:
13+
mypy-check:
14+
name: Mypy
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.12"
22+
23+
- name: Install system dependencies
24+
run: |
25+
sudo apt update
26+
sudo apt install libcairo2-dev git
27+
28+
- name: Clone Ignis repository
29+
run: |
30+
git clone https://github.com/linkfrg/ignis.git src
31+
32+
- name: Install Python dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
cd src
36+
pip install --no-deps --config-settings=setup-args="-Dbuild_gvc=false" --config-settings=setup-args="-Ddependency_check=false" .
37+
pip install -r dev.txt
38+
grep -vE "PyGObject|setuptools" requirements.txt | pip install -r /dev/stdin
39+
cd ..
40+
41+
- name: Run mypy analysis
42+
run: |
43+
mypy
44+
45+
ruff-check:
46+
name: Ruff
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: "3.12"
54+
- name: Install Python dependencies
55+
run: |
56+
python -m pip install --upgrade pip
57+
pip install ruff
58+
59+
- name: Check code
60+
run: ruff check
61+
62+
- name: Check format
63+
run: ruff format --check

‎pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[tool.mypy]
22
python_version = "3.10"
3-
files = ["ignis", "/sda3/ignis/ignis"] # replace /sda3/ignis/ignis with the actual path to Ignis sources
43
exclude = ["venv"]
54
disable_error_code = [
65
"no-redef", # allow variable redefinition (needed for GObject.Property decorator)

0 commit comments

Comments
 (0)
Please sign in to comment.