Skip to content

Commit

Permalink
Decrease minimal Clojure version in Leiningen plugin to 1.10.0 (#883)
Browse files Browse the repository at this point in the history
Turns out, it was a bad idea to set the minimal Clojure version to 1.10.3 - a patch version that was released much later than the original 1.10.0. As we don't really need it, it's better to relax the requirement.
  • Loading branch information
alexander-yakushev authored Jun 13, 2024
1 parent 7fdca13 commit 9599297
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#883](https://github.com/clojure-emacs/cider-nrepl/pull/883): Reduce minimal Clojure requirement to 1.10.0.

## Bugs fixed

* [CIDER#3684](https://github.com/clojure-emacs/cider/issues/3684): Don't apply indentation inference for `:style/indent nil` metadata.
Expand Down
6 changes: 3 additions & 3 deletions src/cider_nrepl/plugin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[leiningen.core.main :as lein]))

(def minimum-versions {:lein "2.8.3"
:clojure "1.10.3"})
:clojure "1.10.0"})

(defn valid-version? [kind version] (lein/version-satisfies? version (minimum-versions kind)))
(def valid-lein-version? (partial valid-version? :lein))
Expand Down Expand Up @@ -46,9 +46,9 @@
(when-not lein-version-ok?
(lein/warn "Warning: cider-nrepl requires Leiningen 2.8.3 or greater."))
(when-not clojure-version-ok?
(lein/warn "Warning: cider-nrepl requires Clojure 1.10.3 or greater."))
(lein/warn "Warning: cider-nrepl requires Clojure 1.10.0 or greater."))
(when clojure-excluded?
(lein/warn "Warning: Clojure is excluded, assuming an appropriate fork (Clojure 1.10.3 or later) is provided."))
(lein/warn "Warning: Clojure is excluded, assuming an appropriate fork (Clojure 1.10.0 or later) is provided."))
(when-not (and lein-version-ok? clojure-version-ok?)
(lein/warn "Warning: cider-nrepl will not be included in your project."))

Expand Down
4 changes: 2 additions & 2 deletions test/clj/cider/nrepl/plugin_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
(is (= expected-output
(middleware {:dependencies [['org.clojure/clojure]]}))))
(testing "defined versions also work"
(is (= (update-in expected-output [:dependencies 0] conj "1.10.3")
(middleware {:dependencies [['org.clojure/clojure "1.10.3"]]})))))
(is (= (update-in expected-output [:dependencies 0] conj "1.10.0")
(middleware {:dependencies [['org.clojure/clojure "1.10.0"]]})))))
4 changes: 2 additions & 2 deletions test/common/cider_nrepl/plugin_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(binding [lein/*info* false]
(with-redefs [lein/leiningen-version (constantly (plugin/minimum-versions :lein))]
(testing "Valid Lein version; valid Clojure version"
(let [project (plugin/middleware '{:dependencies [[org.clojure/clojure "1.10.3"]]})]
(let [project (plugin/middleware '{:dependencies [[org.clojure/clojure "1.10.0"]]})]
(is (contains-cider-nrepl-dep? project))
(is (contains-cider-nrepl-middleware? project))))

Expand All @@ -39,7 +39,7 @@

(with-redefs [lein/leiningen-version (constantly "2.5.1")]
(testing "Invalid Lein version; valid Clojure version"
(let [project (plugin/middleware '{:dependencies [[org.clojure/clojure "1.10.3"]]})]
(let [project (plugin/middleware '{:dependencies [[org.clojure/clojure "1.10.0"]]})]
(is (not (contains-cider-nrepl-dep? project)))
(is (not (contains-cider-nrepl-middleware? project)))))

Expand Down

0 comments on commit 9599297

Please sign in to comment.