clojure-style-guide
clojure-style-guide copied to clipboard
Addition: no naked use or require/refer-all
Will do.
That said, as Technomancy pointed out, it is pretty standard to test files naked using or require/referring clojure.test and the ns under test. Maybe we could mention that in the style guide.
Prefer using :require :refer :all over :use in ns macro.
:refer :all is better than :use. However it is even better using refer explicitly like :refer [func-name].
I would like to suggest change it to
Prefer using :require :refer [func-name], in case of referring to all functions in a namespace, use :require :refer :all, instead of :use.
But is there a solid argument to using :require :refer :all over :use? I mean, if they do the same thing, :use seems more readable.
Definition of use calling to refer: https://github.com/clojure/clojure/blob/43cc1854508d655e58e377f84836ba128971f90c/src/clj/clojure/core.clj#L5727-L5736