-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (73 loc) · 2.35 KB
/
lint.yml
File metadata and controls
89 lines (73 loc) · 2.35 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Lint & Format Check
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint with Ruff
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: 'pip'
- name: Install Ruff
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff linter
run: |
ruff check . --output-format=github --exclude _graveyard
continue-on-error: false
- name: Check Ruff formatting
run: |
ruff format --check . --exclude _graveyard
continue-on-error: false
- name: Code Review Comments (Optional)
if: github.event_name == 'pull_request' && env.ENABLE_CODE_REVIEW_COMMENTS == 'true'
env:
ENABLE_CODE_REVIEW_COMMENTS: ${{ vars.ENABLE_CODE_REVIEW_COMMENTS || 'false' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m backend.code_review.main
continue-on-error: true
type-check:
name: Type Check (Optional)
runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true # Type checking is optional for now
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install mypy
- name: Run MyPy (optional - won't fail CI)
run: |
mypy backend/ --ignore-missing-imports --no-error-summary || true
continue-on-error: true