-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.6 KB
/
Copy pathlint.yml
File metadata and controls
64 lines (54 loc) · 1.6 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
name: Python Linting
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
# cache: 'pip'
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
version: 0.1.13
- name: Create virtual environment with uv
run: |
cd Grasshopper
uv venv
- name: Install dependencies
run: |
cd Grasshopper
source .venv/bin/activate
uv pip install -e .
uv pip install -r requirements.txt
uv pip install black flake8 isort mypy
- name: Lint with flake8
run: |
cd Grasshopper
source .venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 grasshopper --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 grasshopper --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
- name: Check formatting with black
run: |
cd Grasshopper
source .venv/bin/activate
black --check --diff grasshopper
- name: Check imports with isort
run: |
cd Grasshopper
source .venv/bin/activate
isort --check-only --profile black grasshopper
- name: Type check with mypy
run: |
cd Grasshopper
source .venv/bin/activate
mypy --ignore-missing-imports grasshopper