Skip to content

Commit 55f12df

Browse files
committed
ci: add Python linting and formatting workflow
1 parent 821defb commit 55f12df

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# .github/workflows/python-lint-format.yml
2+
name: Python CI - Lint & Format
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- "feature/**"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
lint-format:
15+
name: Lint, Format, Type Check, Security
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install black flake8 mypy bandit
31+
32+
- name: Check formatting with Black
33+
run: black --check .
34+
35+
- name: Run Flake8 linter
36+
run: flake8 .
37+
38+
- name: Run Mypy type checking
39+
run: mypy .
40+
41+
- name: Run Bandit security scan
42+
run: bandit -r .

0 commit comments

Comments
 (0)