-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (65 loc) · 1.82 KB
/
Copy pathcode-quality.yml
File metadata and controls
83 lines (65 loc) · 1.82 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Code Quality
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
code-quality:
name: Code Quality Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Install dependencies
run: |
uv sync
uv pip install ruff mypy
- name: Run Ruff (linting)
run: |
uv run ruff check app/ tests/ --diff
- name: Run Ruff (formatting check)
run: |
uv run ruff format --check --diff app/ tests/
- name: Run MyPy (type checking)
run: |
uv run mypy app/ --ignore-missing-imports --no-strict-optional
- name: Run Ruff security checks
run: |
uv run ruff check app/ tests/ --select S
- name: Check for TODO/FIXME comments
run: |
echo "Checking for TODO/FIXME comments..."
if grep -r "TODO\|FIXME" app/ tests/ --exclude-dir=__pycache__ || true; then
echo "Found TODO/FIXME comments. Consider addressing them."
fi
complexity-check:
name: Complexity Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install tools
run: |
pip install radon xenon
- name: Check cyclomatic complexity
run: |
radon cc app/ -a -nb
- name: Check maintainability index
run: |
radon mi app/ -nb
- name: Check for complex functions
run: |
xenon --max-absolute B --max-modules A --max-average A app/