-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.36 KB
/
python-lint.yml
File metadata and controls
47 lines (38 loc) · 1.36 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
name: Python Lint
on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ '**' ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# MONOREPO: Uncomment and adjust path if in monorepo subdirectory
# cache: 'pip'
# cache-dependency-path: 'subdirectory/requirements.txt'
# Note: Cache may fail in monorepo - disable if you get path resolution errors
- name: Install dependencies
# MONOREPO: Add working-directory if in subdirectory
# working-directory: ./subdirectory
run: |
python -m pip install --upgrade pip
pip install ruff mypy black
- name: Check code formatting with black
# MONOREPO: Add working-directory if in subdirectory
# working-directory: ./subdirectory
run: black --check .
- name: Run ruff linter
# MONOREPO: Add working-directory if in subdirectory
# working-directory: ./subdirectory
run: ruff check .
- name: Run mypy type checker
# MONOREPO: Add working-directory if in subdirectory
# working-directory: ./subdirectory
run: mypy . || echo "Type checking optional"
continue-on-error: true