Skip to content

Commit 429965b

Browse files
committed
PermitCheck reformat
1 parent 934c330 commit 429965b

34 files changed

Lines changed: 3856 additions & 1826 deletions

.github/workflows/code-quality.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
9+
jobs:
10+
lint-and-type-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
with:
19+
enable-cache: true
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install dependencies
27+
run: |
28+
uv pip install --system -e ".[dev]"
29+
uv pip install --system mypy ruff
30+
31+
- name: Lint with ruff
32+
run: |
33+
ruff check permitcheck/ --output-format=github
34+
continue-on-error: true
35+
36+
- name: Format check with ruff
37+
run: |
38+
ruff format --check permitcheck/
39+
continue-on-error: true
40+
41+
- name: Type check with mypy
42+
run: |
43+
mypy permitcheck/ --ignore-missing-imports --no-strict-optional
44+
continue-on-error: true
45+
46+
- name: Check for security issues
47+
run: |
48+
uv pip install --system bandit
49+
bandit -r permitcheck/ -f json -o bandit-report.json || true
50+
continue-on-error: true
51+
52+
- name: Upload reports
53+
uses: actions/upload-artifact@v4
54+
if: always()
55+
with:
56+
name: code-quality-reports
57+
path: |
58+
bandit-report.json

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
publish:
9+
description: 'Publish to PyPI'
10+
required: true
11+
type: boolean
12+
default: false
13+
14+
jobs:
15+
build-and-publish:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
id-token: write # Required for trusted publishing
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
enable-cache: true
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Install build dependencies
35+
run: |
36+
uv pip install --system build twine
37+
38+
- name: Build package
39+
run: |
40+
python -m build
41+
42+
- name: Check package
43+
run: |
44+
twine check dist/*
45+
46+
- name: Publish to PyPI
47+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish)
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
skip-existing: true
51+
52+
- name: Upload artifacts
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: dist-packages
56+
path: dist/

0 commit comments

Comments
 (0)