-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (59 loc) · 2.23 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
name: check lint and format
on: [push, pull_request]
jobs:
lint-web-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10" # update version(s) as needed
- name: Install dependencies
if: ${{ hashFiles('web-app/**/*.py') != '' }}
run: |
cd web-app
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv sync --dev --python $(which python)
pipenv shell --fancy --python $(which python)
- name: Lint with pylint
if: ${{ hashFiles('web-app/**/*.py') != '' }}
# you may set pylint to ignore any files or dependencies that make no sense to lint
run: |
cd web-app
pipenv run pylint **/*.py
- name: Format with black
if: ${{ hashFiles('web-app/**/*.py') != '' }}
# you may set black to ignore any files or dependencies that make no sense to format
run: |
cd web-app
pipenv run black --diff --check .
lint-machine-learning-client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10" # update version(s) as needed
- name: Install dependencies
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
run: |
cd machine-learning-client
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv sync --dev --python $(which python)
pipenv shell --fancy --python $(which python)
- name: Lint with pylint
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
# you may set pylint to ignore any files or dependencies that make no sense to lint
run: |
cd machine-learning-client
pipenv run pylint **/*.py
- name: Format with black
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
# you may set black to ignore any files or dependencies that make no sense to format
run: |
cd machine-learning-client
pipenv run black --diff --check .