forked from iiasa/message-ix-models
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.5 KB
/
lint.yaml
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: Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Maximum McCabe complexity for code
max-complexity: 14
jobs:
lint:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Cache Python packages
uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: lint-${{ runner.os }}
- name: Upgrade pip and install requirements
run: |
python -m pip install --upgrade pip
pip install black flake8 isort mypy setuptools-scm twine wheel
- name: Check "black" code style
run: black --check .
- name: Lint with flake8 & isort
run: |
flake8 --count --max-complexity=${{ env.max-complexity }} --show-source --statistics
isort --check-only .
- name: Check out ixmp
uses: actions/checkout@v2
with:
repository: iiasa/ixmp
path: ixmp
- name: Check out message-ix
uses: actions/checkout@v2
with:
repository: iiasa/message_ix
path: message-ix
- name: Check typing with mypy
# Give the paths to ixmp and message_ix sources. These need not be
# installed for static type checking
env:
MYPYPATH: "./ixmp/:./message-ix/"
# Also install stub packages and others that provide type hints
run: |
pip install genno iam-units pytest sdmx1 types-PyYAML types-setuptools
mypy ./message_ix_models