technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slamhound doesn't recognize #'foo.bar/baz as a need to require foo.bar

kenrestivo opened this issue · comments

A pattern often used in ring apps is to have in a server namespace, a call to start-server that passes as an arg, #'foo.handlers/app , so that one can dynamically mess around with the ring/compojure handler stack without restarting the server, and keep the handlers in a different ns than the call to start the ring server.

slamhound doesn't see that var. If I manually add (:require foo.handlers) to the ns declaration, slamhound will remove it out from under me.

I have hacked around this by creating a dummy function in foo.handlers called slamhound-hack and then calling it uselessly inside the other ns. This seems to prevent slamhound from removing the :require.

This is basically a duplicate of #19

This is actually different from #19 assuming there's no syntax-quote going on. Fully-qualified references will sneak around slamhound; there's no way for it to catch references unless they depend upon :as aliases or :refer. This is just an inherent part of the approach it uses; there's really no way to fix it. But it should be documented.