Add and apply indent helper recipe
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 23 Nov 2020 00:18:34 +0000 (19:18 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 23 Nov 2020 00:18:34 +0000 (19:18 -0500)
Makefile
tt.rkt

index 4e5863e..882fda6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,12 @@
+SRC_FILE := tt.rkt
+
 .PHONY: install
 install:
        raco pkg install --deps search-auto
 
 .PHONY: test
 test:
-       raco test ./tt.rkt
+       raco test ./$(SRC_FILE)
 
 .PHONY: remove
 remove:
@@ -13,3 +15,10 @@ remove:
 .PHONY: clean
 clean:
        rm -rf compiled
+
+### dev helpers ###
+# scmindent.rkt : https://github.com/ds26gte/scmindent
+# sponge        : https://joeyh.name/code/moreutils
+.PHONY: indent
+indent:
+       scmindent.rkt < $(SRC_FILE) | sponge $(SRC_FILE)
diff --git a/tt.rkt b/tt.rkt
index 8930ae9..f444926 100644 (file)
--- a/tt.rkt
+++ b/tt.rkt
   (string-split str (regexp "[\r\n]+")))
 
 (module+ test
-  (check-equal? (str->lines "abc\ndef\n\nghi") '("abc" "def" "ghi")))
+         (check-equal? (str->lines "abc\ndef\n\nghi") '("abc" "def" "ghi")))
 
 (define (str->msgs nick uri str)
   (filter-map (λ (line) (str->msg nick uri line)) (str->lines str)))
This page took 0.025626 seconds and 4 git commands to generate.