Skip to content

Commit

Permalink
Merge pull request #234 from tomjkidd/issue-231
Browse files Browse the repository at this point in the history
Fix Issue 231
  • Loading branch information
danielcompton authored Sep 29, 2019
2 parents f9b9546 + 2c7b4a2 commit 829056f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions kibit/src/kibit/check/reader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
(defmethod derive-aliases 'ns
[[_ _ns & ns-asserts]]
(->> ns-asserts
(remove #(or (string? %) (map? %)))
(group-by (comp keyword name first))
((juxt :require :require-macros))
(apply concat)
Expand Down
11 changes: 11 additions & 0 deletions kibit/test/kibit/test/check_reader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
(deftest derive-aliases-test
(are [expected-alias-map ns-form]
(= expected-alias-map (reader/derive-aliases ns-form))
'{foo foo.bar.baz} '(ns derive.test.one
"This is a namespace string, which should not cause problems"
{:author "Alice"
:purpose "Make sure that attr-map also doesn't cause problems"}
(:require [foo.bar.baz :as foo]))
'{foo foo.bar.baz} '(ns ^{:doc "Docstring as metadata"}
derive.test.one
(:require [foo.bar.baz :as foo]))
'{foo foo.bar.baz} '(ns ^:metadata-x derive.test.one
(:require [foo.bar.baz :as foo]))

'{foo foo.bar.baz} '(ns derive.test.one
(:require [foo.bar.baz :as foo]))
'{foo foo.bar.baz
Expand Down

0 comments on commit 829056f

Please sign in to comment.