generated from freelawproject/new-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 32
101 lines (82 loc) · 2.67 KB
/
lint.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Lint
on:
push:
branches-ignore:
- 'artifacts'
pull_request:
branches-ignore:
- 'artifacts'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install hyperscan
run: sudo apt-get install libhyperscan-dev
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock')}}
- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Activate venv
run: |
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
- name: Black Code Formatter
uses: psf/black@stable
- name: Run flake8
uses: py-actions/flake8@v1
- name: isort Import Sorter
uses: isort/[email protected]
- name: pylint Error Checker
run: pylint --fail-under 9 -f colorized eyecite
- name: mypy Static Type Checker
run: mypy .
lint-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock')}}
- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Activate venv
run: |
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
- name: pylint Generate Report
run: >
pylint --exit-zero --load-plugins=pylint_json2html -f json eyecite |
pylint-json2html -f json -o pylint-report.html
- name: Upload report
uses: actions/upload-artifact@v2
with:
name: pylint report
path: pylint-report.html