-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.43 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
# Run various link checks, like flake8 and black, to make sure
# our code remains in good shape, avoids common bugs, and follows
# common coding conventions.
name: lint
on:
push:
branches-ignore:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linting:
runs-on: ubuntu-latest
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.10
#----------------------------------------------
# load pip cache if cache exists
#----------------------------------------------
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: ${{ runner.os }}-pip
#----------------------------------------------
# run isort
#----------------------------------------------
- run: python -m pip install isort
- run: |
isort --profile black ./src ./tests
#----------------------------------------------
# run black
#----------------------------------------------
- run: python -m pip install black[jupyter]
- run: |
black ./src ./tests --diff
black ./src ./tests --check