technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.
Other
473 stars 38 forks source link

defrecord/deftype namespaces not properly required #64

Closed bostonaholic closed 10 years ago

bostonaholic commented 10 years ago

The namspace of a defrecord/deftype must also be required.

See the following example:

src/my/domain/file_header.clj

(ns my.domain.file-header)

(defprotocol Whatever
  ...)

(defrecord FileHeader [args]
  Whatever
  ...)

my/domain/core.clj

(ns my.domain.core
  (:require [my.domain.file-header :refer :all])
  (:import (my.domain.file_header FileHeader))

But slamhound is forgetting the :require piece. The same goes for deftype.

guns commented 10 years ago

Hello, thank you for reporting!

Yes, this is an oversight. This escaped my notice because I either always AOT compile my artifacts or the necessary namespace just happens to be required to satisfy other unqualified references.

I'll take a look at this today.

guns commented 10 years ago

Hello,

I believe this fixes the issue. Please re-open if you find any errors.

Thank you!

bostonaholic commented 10 years ago

When is the next planned release?

guns commented 10 years ago

I'll make one today if @technomancy agrees.

technomancy commented 10 years ago

Sounds good to me; thanks @guns.

guns commented 10 years ago

Okay 1.5.1 is live on clojars! Happy hacking.

bostonaholic commented 10 years ago

Awesome! Looks like it's working. Thanks.