Skip to content

Commit

Permalink
Make CI fail if code isn't formatted properly
Browse files Browse the repository at this point in the history
To test this, I improperly formatted `tasks.py`. I expect CI to fail.

For:
#60
  • Loading branch information
liammulh committed Jul 3, 2024
1 parent 0345ad2 commit 584d4b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: seed the database
run: pipenv run invoke dbseed
- name: format
run: pipenv run invoke fmt
run: pipenv run invoke fmtcheck
- name: lint
run: pipenv run invoke lint
- name: check types
Expand Down
5 changes: 5 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def fmt(c):
c.run("mdformat README.md")
c.run("mdformat doc")

@task
def fmtcheck(c):
"""Checks if the code is formatted properly."""
c.run("black --check .")


@task
def lint(c):
Expand Down

0 comments on commit 584d4b0

Please sign in to comment.