Skip to content

Commit 0b28720

Browse files
umarcorolofk
authored andcommittedNov 5, 2021
Use black through pre-commit, and enforce it in CI
* [CI] Add job 'Format' * add dev-requirements.txt * add .pre-commit-config.yaml
1 parent 51f00be commit 0b28720

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
 

‎.github/workflows/ci.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,23 @@ on:
1212

1313
jobs:
1414

15-
build:
15+
Format:
16+
name: 🐍 Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: 🧰 Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: 🐍 Setup Python ${{ matrix.pyver }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: '3.10'
27+
28+
- name: 🚦 Run pre-commit Action
29+
uses: pre-commit/action@v2.0.0
30+
31+
Build:
1632
strategy:
1733
fail-fast: false
1834
matrix:

‎.pre-commit-config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Configuration for pre-commit (https://pre-commit.com/), a tool to run
2+
# formatters, linters, and other productivity tools before a commit.
3+
repos:
4+
- repo: https://github.com/psf/black
5+
rev: 21.7b0
6+
hooks:
7+
- id: black

‎dev-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pre-commit>=2.9.0
2+
tox

0 commit comments

Comments
 (0)
Please sign in to comment.