#17 Fix drone configuration for now

Слито
getty слито 18 коммит(ов) из getty/gr/fix-updrone в getty/master 4 лет назад
4 измененных файлов с 22 добавлено и 9 удалено
  1. 8 5
      .drone.yml
  2. 2 0
      README.md
  3. 3 3
      lc/web.py
  4. 9 1
      tasks.py

+ 8 - 5
.drone.yml

@@ -1,12 +1,15 @@
 kind: pipeline
 name: default
 
+workspace:
+  path: /root
+
 steps:
-- name: test
+- name: test_all
   image: python
   commands:
   - pip install poetry
-  - pip install invoke
-  - inv install
-  - inv test
-  - inv tc
+  - poetry install
+  - poetry run inv test
+  - poetry run inv tc
+  - poetry run inv checkfmt

+ 2 - 0
README.md

@@ -1,5 +1,7 @@
 # Lament Configuration
 
+[![Build Status](http://ci.infinitenegativeutility.com/api/badges/getty/lament-configuration/status.svg)](http://ci.infinitenegativeutility.com/getty/lament-configuration)
+
 ![lament configuration logo](/lc/static/lc_64.png)
 
 Bookmark organizing for pinheads.

+ 3 - 3
lc/web.py

@@ -108,9 +108,9 @@ class Endpoint:
             else:
                 page = render(
                     "main",
-                    title="error",
-                    content=f"shit's fucked yo: {exn}",
-                    user=None,
+                    v.Page(
+                        title="error", content=f"shit's fucked yo: {exn}", user=None,
+                    ),
                 )
                 return (page, exn.http_code())
         # also maybe we tried to redirect, so just do that

+ 9 - 1
tasks.py

@@ -28,7 +28,7 @@ def fmt(c):
     """Automatically format the source code, committing it if it is safe to do so."""
     status = c.run("git status --porcelain", hide="stdout")
     is_clean = status.stdout.strip() == ""
-    c.run("poetry run black $(find . -name '*.py')")
+    c.run("poetry run black $(find lc scripts stubs tests *.py -name '*.py')")
 
     if is_clean:
         date = datetime.now().isoformat()
@@ -37,6 +37,14 @@ 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 lc scripts stubs tests *.py -name '*.py')"
+    )
+
+
 @task
 def populate(c):
     """Populate the test database with fake-ish data"""