From 59f035668d482f37b8af8857cdee650d5fe8ed31 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 1 Aug 2025 02:44:12 +0100 Subject: cider + kaocha --- init.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/init.el b/init.el index 9232d94..f6d24b6 100644 --- a/init.el +++ b/init.el @@ -2202,6 +2202,26 @@ (setq mode-name "λ")) :hook (clojure-mode . jao-clojure--fix-things)) +(defun jao-cider-test-ns (ns) + (let ((parts (string-split ns "\\."))) + (if (string= "test" (cadr parts)) + ns + (mapconcat #'identity (cons (car parts) (cons "test" (cdr parts))) ".")))) + +(defun jao-kaocha-file-name () + (let* ((filename (match-string 2)) + (path (replace-regexp-in-string "\\." "/" (match-string 1)))) + (substring-no-properties (concat "test/" path filename)))) + +(defconst jao-kaocha-compilation-error + '(kaocha-error "^FAIL in \\(.+\\.\\)[^ ]+ (\\([^:]+\\.clj[cs]?\\):\\([0-9]+\\))" + jao-kaocha-file-name 3)) + +(use-package compile + :config + (add-to-list 'compilation-error-regexp-alist-alist + jao-kaocha-compilation-error)) + (use-package cider :ensure t :commands cider-mode @@ -2220,6 +2240,7 @@ cider-repl-use-pretty-printing t cider-show-error-buffer 'except-in-repl cider-test-show-report-on-success nil + cider-test-infer-test-ns #'jao-cider-test-ns cider-use-fringe-indicators nil cider-use-overlays nil clojure-docstring-fill-column 72 -- cgit v1.2.3