-
Notifications
You must be signed in to change notification settings - Fork 16
56 lines (48 loc) · 1.35 KB
/
linter.yml
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
name: Python Linter
on:
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 mypy
- name: Run Flake8
id: flake8
continue-on-error: true
run: |
flake8 . \
--exclude=venv,.git,__pycache__ \
--ignore=E226,E302,E41,E501,W291,W293,F401,F403,W503,E203 \
--max-complexity=10
- name: Run Mypy
id: mypy
continue-on-error: true
run: |
mypy . \
--exclude 'venv|.git' \
--ignore-missing-imports \
--allow-untyped-defs \
--allow-incomplete-defs \
--allow-untyped-decorators \
--allow-subclassing-any \
--allow-untyped-calls \
--no-error-summary \
--hide-error-context \
--no-error-summary \
--no-pretty \
--explicit-package-bases \
--namespace-packages
- name: Check for Failures
if: ${{ steps.flake8.outcome == 'failure' || steps.mypy.outcome == 'failure' }}
run: |
echo "::error::Linting checks failed! Please check the logs above for Flake8 and Mypy errors"
exit 1