Browse Source

Add task for checking formatting

Getty Ritter 2 years ago
parent
commit
21ef5b2783
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tasks.py

+ 6 - 0
tasks.py

@@ -37,6 +37,12 @@ def fmt(c):
         print("Uncommitted change exist; skipping commit")
 
 
+@task
+def checkfmt(c):
+    """Automatically format the source code, committing it if it is safe to do so."""
+    return c.run("poetry run black --check $(find . -name '*.py')")
+
+
 @task
 def populate(c):
     """Populate the test database with fake-ish data"""