# HG changeset patch # User alys # Date 2019-06-06 18:00:46 # Node ID ff42990fe5278db870fb22a74b21eb4e5485311b # Parent 00e4925d221b4970a452ecb59e5a36b366563d41 Refactor. 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 @@ -114,19 +114,19 @@ :level :warning ;going with warning because a project might not have a license before release. :follow-up "Add a license to LICENSE. Consider using https://choosealicense.com/ for guidance." }]) +(def false-colors {:suggestion :blue + :warning :yellow + :error :red}) + +(def level-prefixes {:suggestion "Suggested " + :warning "Recommended " + :error "Required "}) + (defn perform-check [check project] (let [{check-name :name :keys [function follow-up level]} check result (function project) - false-color (case level - :suggestion :blue - :warning :yellow - :error :red - :red) - prefix (case level - :suggestion "Suggested " - :warning "Recommended " - :error "Required " - "Follow-up")] + false-color (level false-colors :red) + prefix (level level-prefixes "Follow-up")] {:name check-name :result result :output (if result