-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.31 KB
/
lint.yaml
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
name: Linting and Formatting
on:
push:
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Packages
run: |
sudo apt update
sudo apt install shellcheck
sudo apt install jq
python -m pip install --upgrade pip
pip install black
pip install ruff
pip install pynblint
# Shell Lints
- name: Check shell files
run: |
find . -name '*.sh' | while read file; do
shellcheck $file
done
# Python Lints
- name: Run Black Formatting
run: |
black . && git diff --exit-code || { echo "Code is not black formatted"; exit 1; }
- name: Run Python Lints
run: |
# Checks .ipynb files as well
ruff check .
# JupyterNotebook Lints
- name: Run JupyterNotebook Lints
run: |
set -e
pynblint . --output pynblint.json -q -y
jq -r '.notebook_level_lints[] | .lints | select(length != 0) | error("One or more notebooks has warnings")' pynblint.json || exit 1