From b29e8fc3ca59452454410a77d14e96fc711738a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cam=20Sa=C3=BCl?= <cammsaul@gmail.com> Date: Fri, 12 Feb 2016 17:10:54 -0800 Subject: [PATCH] Use new elide-metadata feature when compiling uberjar :notes: --- project.clj | 3 ++- src/metabase/util.clj | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/project.clj b/project.clj index eb170b613b8..9ea2ebbeafb 100644 --- a/project.clj +++ b/project.clj @@ -94,7 +94,8 @@ "-Dmb.jetty.port=3010" "-Dmb.api.key=test-api-key" "-Xverify:none"]} ; disable bytecode verification when running tests so they start slightly faster - :uberjar {:aot :all} + :uberjar {:aot :all + :jvm-opts ["-Dclojure.compiler.elide-meta=[:doc :added :file :line]"]} :generate-sample-dataset {:dependencies [[faker "0.2.2"] ; Fake data generator -- port of Perl/Ruby [incanter/incanter-core "1.9.0"]] ; Satistical functions like normal distibutions}}) :source-paths ["sample_dataset"] diff --git a/src/metabase/util.clj b/src/metabase/util.clj index 45fe0a52e32..ed4bcc99b52 100644 --- a/src/metabase/util.clj +++ b/src/metabase/util.clj @@ -7,7 +7,8 @@ [clj-time.coerce :as coerce] [clj-time.format :as time] [colorize.core :as color] - [medley.core :as m]) + [medley.core :as m] + [metabase.config :as config]) (:import clojure.lang.Keyword (java.net Socket InetSocketAddress @@ -369,11 +370,10 @@ (defn require-dox-in-this-namespace "Throw an exception if any public interned symbol in this namespace is missing a docstring." [] - (->> (ns-publics *ns*) - (map (fn [[symb varr]] - (when-not (:doc (meta varr)) - (throw (Exception. (format "All public symbols in %s are required to have a docstring, but %s is missing one." (.getName *ns*) symb)))))) - dorun)) + (when-not config/is-prod? + (doseq [[symb varr] (ns-publics *ns*) + :when (not (:doc (meta varr)))] + (throw (Exception. (format "All public symbols in %s are required to have a docstring, but %s is missing one." (.getName *ns*) symb)))))) (defmacro pdoseq "(Almost) just like `doseq` but runs in parallel. Doesn't support advanced binding forms like `:let` or `:when` and only supports a single binding </3" -- GitLab