Skip to content

Commit 3fa966d

Browse files
committed
Use pre-commit for checks, and add isort and black
1 parent eefccd9 commit 3fa966d

4 files changed

Lines changed: 50 additions & 36 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
default:
7+
runs-on: ${{ matrix.os }}-latest
8+
strategy:
9+
matrix:
10+
os: [ubuntu]
11+
python-version: [3.10]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flake8 pytest
24+
pip install -r requirements.txt -r requirements.dev.txt
25+
26+
- name: Lint
27+
run: pre-commit run --all-files --show-diff-on-failure --color always
28+
29+
- name: Test
30+
run: |
31+
PYTHONPATH=. pytest

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Install pre-commit hooks via
2+
# pre-commit install
3+
4+
repos:
5+
- repo: https://github.com/psf/black
6+
rev: 21.5b1
7+
hooks:
8+
- id: black
9+
- repo: https://gitlab.com/pycqa/flake8
10+
rev: 3.8.4
11+
hooks:
12+
- id: flake8
13+
pass_filenames: true
14+
- repo: https://github.com/pycqa/isort
15+
rev: 5.10.1
16+
hooks:
17+
- id: isort

requirements.dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
black==21.5b1
2+
pre-commit>=2.12

0 commit comments

Comments
 (0)