浏览代码

Add task for checking formatting

Getty Ritter 4 年之前
父节点
当前提交
21ef5b2783
共有 1 个文件被更改,包括 6 次插入0 次删除
  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"""