-
-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (41 loc) · 1.07 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
name: Lint
on:
pull_request:
workflow_dispatch:
push:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/conda-setup
with:
python-version: "3.12"
extras: "dev"
- name: Install pre-commit
shell: bash -l {0}
run: conda install pre-commit nbconvert
- name: List Python package versions
shell: bash -l {0}
run: conda list
- name: Run notebook clearing check first (no diff)
shell: bash -l {0}
env:
RUFF_OUTPUT_FORMAT: github
run: |
pre-commit run jupyter-notebook-clear-output --all-files
- name: Switch to a temporary branch
shell: bash -l {0}
run: |
git checkout -b _ci_branch_
- name: Run pre-commit on all files
shell: bash -l {0}
env:
RUFF_OUTPUT_FORMAT: github
run: |
pre-commit run \
--show-diff-on-failure \
--color=always \
--all-files