Skip to content

Commit b27364c

Browse files
authored
Merge pull request #496 from nschloe/pre-commit
add pre-commit
2 parents 538e1c0 + 004891b commit b27364c

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/setup-python@v2
16-
with:
17-
python-version: "3.x"
18-
- uses: actions/checkout@v2
19-
- name: Lint with flake8
20-
run: |
21-
pip install flake8
22-
flake8 .
23-
- name: Lint with black
24-
run: |
25-
pip install black
26-
black --check .
15+
- name: Check out repo
16+
uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
- name: Run pre-commit
20+
uses: pre-commit/[email protected]
2721

2822
build:
2923
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/PyCQA/isort
3+
rev: 5.9.1
4+
hooks:
5+
- id: isort
6+
7+
- repo: https://github.com/python/black
8+
rev: 21.6b0
9+
hooks:
10+
- id: black
11+
language_version: python3
12+
13+
- repo: https://gitlab.com/pycqa/flake8
14+
rev: 3.9.2
15+
hooks:
16+
- id: flake8

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=42", "wheel"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.isort]
6+
profile = "black"

0 commit comments

Comments
 (0)