 (ns R
   (:refer-clojure :exclude [find-ns])
-  (:require [clojure.test :as test]
-            [clojure.repl :as repl]
-            [kaocha.repl]
-            clojure.pprint
-            [clojure.tools.namespace.find :as ns.find]
-            [clojure.tools.namespace.repl :as ns.repl]
-            [clojure.java.io :as io])
-  (:import (java.io File)))
+  (:require
+    [clojure.java.io :as io]
+    [clojure.pprint]
+    [clojure.repl :as repl]
+    [clojure.test :as test]
+    [clojure.tools.namespace.find :as ns.find]
+    [clojure.tools.namespace.repl :as ns.repl]
+    [kaocha.repl])
+  (:import
+    (java.io
+      File)))
+
 
 (ns.repl/disable-reload! *ns*)
+(def ^{:doc "Pretty print a thing"} pp clojure.pprint/pprint)
+
 
 (defn help [& n]
   (println (str ">>> in ns " 'R))

  ([]
   (list-ns "./src/")))

(defn find-ns
  "Find namespace vars by a regex"
  [re]
  (filter #(re-find re (str %)) (list-ns)))

(defn find-test-ns
  "Find test namespace vars by a regex"
  [re]
  (filter #(re-find re (str %)) (list-ns "./test/")))

(defn t
  "Run tests via kaocha - either all or a list of vars"
  ([]
   (kaocha.repl/run :unit))
  ([ns-list]
   (apply kaocha.repl/run ns-list)))

(defn t!
  "Run tests via kaocha, but refresh first - runs all tests or a list of vars"
  ([]
   (refresh)
   (kaocha.repl/run :unit))
  ([ns-list]
   (refresh)
   (apply kaocha.repl/run ns-list)))

(def system-status (atom {}))

(defn start-system!
  "Given a namespace, usually some-service, do the following:

          (println v)) (ns-publics 'R))
  ::ok)


(defn init! []
  (ns.repl/disable-reload! *ns*)
  (ns.repl/set-refresh-dirs "src" "test")
  (help))


(defn list-ns
  "Return list of symbols of namespaces found in src dir"
