-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (38 loc) · 1.13 KB
/
code-quality.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
name: Check Formatting
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
poetry install --no-interaction --no-root
poetry run pip install ruff flake8
- name: Run Ruff
run: poetry run ruff check .
- name: Run Ruff formatter
run: poetry run ruff format . --check
- name: Run Flake8
run: poetry run flake8
- name: Check for merge conflicts
run: |
! grep -rn "^<<<<<<< HEAD" --exclude-dir={.git,.github}
- name: Check for debug statements
run: |
! grep -rn "import pdb" --exclude-dir={.git,.github}
! grep -rn "import ipdb" --exclude-dir={.git,.github}
! grep -rn "import pudb" --exclude-dir={.git,.github}
- name: Check for trailing whitespace
run: |
! grep -rn "[[:blank:]]$" --exclude-dir={.git,.github}