File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,6 +181,21 @@ classpath. Classpath-relative paths have prefix of @ or @/")
181181 [cfg level]
182182 (assoc-in cfg [:options :optimizations ] (keyword level)))
183183
184+ (defn- promote-warn-opt
185+ [cfg warn-type-str]
186+ (let [warn-type (keyword warn-type-str)]
187+ (cond
188+ (= :all warn-type)
189+ (assoc-in cfg [:options :warnings ] :error )
190+
191+ (contains? ana/*cljs-warnings* warn-type)
192+ (assoc-in cfg [:options :warnings warn-type] :error )
193+
194+ :else
195+ (throw
196+ (ex-info (str " Unknown warning type: " warn-type)
197+ {:cfg cfg :warn-type warn-type})))))
198+
184199(defn- output-to-opt
185200 [cfg path]
186201 (assoc-in cfg [:options :output-to ] path))
@@ -682,6 +697,13 @@ generic - the combinations must be explicitly supported"}
682697 (str " Set optimization level, only effective with "
683698 " --compile main option. Valid values are: none, "
684699 " whitespace, simple, advanced" )}
700+ [" -Werror" ] {:group ::compile
701+ :fn promote-warn-opt
702+ :arg " warning-type"
703+ :doc (str " Promote a warning type to error. If |\" all|\" or no argument supplied "
704+ " serious warnings are promoted to errors." )
705+ :optional-arg? true
706+ :default " all" }
685707 [" -t" " --target" ] {:group ::main&compile :fn target-opt
686708 :arg " name"
687709 :doc
You can’t perform that action at this time.
0 commit comments