-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (56 loc) · 1.64 KB
/
Copy pathquality.yml
File metadata and controls
64 lines (56 loc) · 1.64 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
name: quality
on:
pull_request:
paths:
- '**/*.py'
- '.pyscn.toml'
- 'pyproject.toml'
push:
branches:
- main
paths:
- '**/*.py'
- '.pyscn.toml'
- 'pyproject.toml'
jobs:
pyscn:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
make init-uv
make install
- name: Quality check with pyscn
run: make lint-quality
- name: Generate pyscn report
if: always()
run: make lint-quality-report
- name: Upload pyscn report
if: always()
uses: actions/upload-artifact@v4
with:
name: pyscn-report
path: .pyscn/reports/*.html
- name: Comment pyscn summary on PR
if: >-
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
env:
GH_TOKEN: ${{ github.token }}
run: |
uv run pyscn analyze --json --output - . | jq -r '
"## pyscn report\n" +
"- **Health Score:** " + (.summary.health_score | tostring) + " / 100 (" + .summary.grade + ")\n" +
"- Complexity: " + (.summary.complexity_score | tostring) + "\n" +
"- Dead code: " + (.summary.dead_code_score | tostring) + "\n"
' > comment.md
gh pr comment "${{ github.event.pull_request.number }}" --body-file comment.md