Skip to content

Commit

Permalink
Fix ns requires - compojure.core
Browse files Browse the repository at this point in the history
The compojure template required the compojure.core library by referring all
 functions from that namespace.  While this does give convienience of just using
 the function name without a namespace, it does mean many functions not used are
 included.

(ns status-monitor.handler
  (:require [compojure.core :refer :all]))

Using this form also raises a warning from the Joker linting tool that I have
running in Spacemacs.

To be more specific when using the compojure.core library, I changed the require
 to refer the specific functions / macros used, defroutes and GET

 (:require [compojure.core :refer [defroutes GET]]

Stating exactly which functions you are using from each library helps with
maintaining the code as well as minimising unknown conflicts.
  • Loading branch information
practicalli-johnny committed Oct 21, 2018
1 parent 31240db commit 7b8c3a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/status_monitor/handler.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns status-monitor.handler
(:require [compojure.core :refer :all]
(:require [compojure.core :refer [defroutes GET]]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]
[hiccup.core :refer :all]
Expand Down

0 comments on commit 7b8c3a8

Please sign in to comment.