Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
- name: Lint with Sqlfluff
run: make lint-sql

- name: Quality check with pyscn
run: make lint-quality

type-check:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ lint-docstrings:
lint-quality:
uv run pyscn check .

lint-quality-report:
uv run pyscn analyze --no-open --html .

type:
uv run pyrefly check

Expand Down
Loading