# HG changeset patch # User alys # Date 2018-10-15 19:12:44 # Node ID 1bae6efb79995e4d97cbc27477081161f42bd799 # Parent bc412e2569135f39ad981c52392e7545cac0cb11 Tidy output. diff --git a/project.clj b/project.clj --- a/project.clj +++ b/project.clj @@ -1,5 +1,5 @@ -(defproject project-checkup "0.1.3" - :description "FIXME: write description" +(defproject project-checkup "0.1.4-SNAPSHOT" + :description "Makes sure your project is healthy. " :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} diff --git a/src/project_checkup/core.clj b/src/project_checkup/core.clj --- a/src/project_checkup/core.clj +++ b/src/project_checkup/core.clj @@ -30,6 +30,7 @@ ; files (string/split (:out (shell/sh "hg" "st" "-m" "-a" "-r" "-d" "-c" "-n" )) #"\n") files (map #(clojure.string/replace % #"./(.*)" "$1") all-files ) + ; file-set (set files) ;note that using some here means that if both are present, hg is ;ignored: vcs-systems (set (vector (some #{".git" ".hg"} files))) ] @@ -74,7 +75,7 @@ (= (count (re-find #"(FIXME|TODO)" (:readme project) )) 0)) -(def checks [{:name "Has VCS" +(def checks [{:name "Project is checked into revision control" :description "" :function check-vcs :level :error @@ -83,17 +84,17 @@ :function #(or true %) :level :error :follow-up "This is a bug." } - {:name "Has Untracked" + {:name "All files are tracked or ignored" :description "" :function check-untracked :level :warning :follow-up "Commit or ignore files from 'hg st -u' or 'git ls-files --others --exclude-standard'." } - {:name "No Todo" + {:name "Project has a todo file" :function check-taskpaper :description "" :level :suggestion :follow-up "Add a todo file using Taskpaper." } - {:name "Has Readme" + {:name "Has README" :function check-readme :description "Readme exists" :level :suggestion @@ -113,12 +114,23 @@ :suggestion :blue :warning :yellow :error :red - :red) ] + :red) + prefix (case level + :suggestion "Suggested follow-up" + :warning "Recommended follow-up" + :error "Required follow-up" + "Follow-up" + + ) + ] {:name check-name :result result :output (if result - (color :green (str "✓" check-name " passed!")) - (str check-name (color false-color " failed! ") "\n\tFollow up: " follow-up))})) + (color :green (str "✔" check-name "…passed!")) + (str (color false-color (str "❌" check-name "…failed!")) "\n\t" prefix " Follow up: " follow-up) + ; (str check-name (color false-color " failed! ") "\n\tFollow up: " follow-up) + + )})) (defn -main