Skip to content

Commit

Permalink
Bump clojure to 1.11, fix clj-commons#237, fix clj-commons#238
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed May 15, 2024
1 parent 18f0227 commit 54c2edc
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:url "https://github.com/clj-commons/kibit"
:connection "scm:git:git://github.com/clj-commons/kibit.git"
:developerConnection "scm:git:ssh://git@github.com/clj-commons/kibit.git"}
:dependencies [[org.clojure/clojure "1.8.0"]
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/core.logic "1.1.0"]
[org.clojure/tools.cli "1.1.230"]
[rewrite-clj "1.1.47"]
Expand Down
4 changes: 2 additions & 2 deletions src/kibit/check/reader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
(rest form))

(option-spec? form)
(let [[_ as? form-alias] form]
(deps-from-libspec prefix (first form) (when (= :as as?) form-alias)))
(let [opts (apply hash-map (next form))]
(deps-from-libspec prefix (first form) (or (:as opts) (:as-alias opts))))

(symbol? form)
(list (with-meta
Expand Down
3 changes: 2 additions & 1 deletion test/kibit/test/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"Hello" '(do "Hello")
'(when test then) '(do (when test then))
:one '(do :one)
{:one 1} '(do {:one 1})))
{:one 1} '(do {:one 1})
#{:a :b} '#{(do :a) (do :b)}))

;; This test confirms when checking will happen and when it won't
(deftest simplify-exprs
Expand Down
24 changes: 21 additions & 3 deletions test/kibit/test/driver.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
false "test.resources/fourth.txt"))

(deftest find-clojure-sources-are
(is (= [(io/file "test/resources/first.clj")
(is (= [(io/file "test/resources/as_alias.clj")
(io/file "test/resources/double_pound_reader_macros.clj")
(io/file "test/resources/first.clj")
(io/file "test/resources/keyword_suggestions.clj")
(io/file "test/resources/keywords.clj")
(io/file "test/resources/namespaced_maps.clj")
(io/file "test/resources/reader_conditionals.cljc")
(io/file "test/resources/second.cljx")
(io/file "test/resources/sets.clj")
Expand Down Expand Up @@ -44,5 +47,20 @@
(map #(select-keys % [:expr :alt])
(driver/run ["test/resources/keyword_suggestions.clj"] nil "--reporter" "no-op")))))

(deftest process-cljc-file
(is (driver/run ["test/resources/reader_conditionals.cljc"] nil)))
(defmacro with-err-str
[& body]
`(let [s# (java.io.StringWriter.)]
(binding [*err* s#]
~@body
(str s#))))

(deftest process-reader-macros
(is (= ["" "" "" ""]
[(with-err-str
(driver/run ["test/resources/reader_conditionals.cljc"] nil))
(with-err-str
(driver/run ["test/resources/double_pound_reader_macros.clj"] nil))
(with-err-str
(driver/run ["test/resources/namespaced_maps.clj"] nil))
(with-err-str
(driver/run ["test/resources/as_alias.clj"] nil))])))
5 changes: 5 additions & 0 deletions test/resources/as_alias.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns resources.as-alias
(:require
[foo.bar :a :b :as-alias fb]))

::fb/example
1 change: 1 addition & 0 deletions test/resources/double_pound_reader_macros.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[##Inf ##-Inf ##NaN]
1 change: 1 addition & 0 deletions test/resources/namespaced_maps.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#:car{:make "Jeep" :model "Wrangler"}

0 comments on commit 54c2edc

Please sign in to comment.