Skip to content

Commit 1ef472b

Browse files
liammulhsanchegm
andauthored
ci: Make CI fail if code isn't formatted properly (#61)
For: #60 --------- Co-authored-by: sanchegm <[email protected]>
1 parent 0f001b5 commit 1ef472b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: install dependencies
3333
run: pipenv sync --dev # Installs all deps, including dev deps, from Pipfile.lock.
3434
- name: format
35-
run: pipenv run invoke fmt
35+
run: pipenv run invoke fmtcheck
3636
- name: lint
3737
run: pipenv run invoke lint
3838
- name: check types

tasks.py

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def fmt(c):
3535
c.run("mdformat doc")
3636

3737

38+
@task
39+
def fmtcheck(c):
40+
"""Checks if the code is formatted properly."""
41+
c.run("black --check .")
42+
43+
3844
@task
3945
def lint(c):
4046
"""Run the linter."""

0 commit comments

Comments
 (0)