Skip to content

Commit 2094051

Browse files
vemvbbatsov
authored andcommitted
Upgrade and satisfy Eastwood
1 parent b237c20 commit 2094051

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

project.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@
6666
with-debug-bindings [[:inner 0]]
6767
merge-meta [[:inner 0]]
6868
try-if-let [[:block 1]]}}}]
69-
:eastwood {:plugins [[jonase/eastwood "0.9.1"]]
69+
:eastwood {:plugins [[jonase/eastwood "0.9.9"]]
7070
:eastwood {;; vendored - shouldn't be tweaked for satisfying linters:
7171
:exclude-namespaces [refactor-nrepl.ns.slam.hound.regrow]
7272
;; :implicit-dependencies would fail spuriously when the CI matrix runs for Clojure < 1.10,
7373
;; because :implicit-dependencies can only work for a certain corner case starting from 1.10.
7474
:exclude-linters [:implicit-dependencies]
75+
:add-linters [:performance :boxed-math]
7576
:config-files ["eastwood.clj"]}}
7677
:clj-kondo [:test
7778
{:dependencies [[clj-kondo "2021.06.18"]]}]}

src/refactor_nrepl/artifacts.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
[]
3838
(or (empty? @artifacts)
3939
(if-let [last-modified (some-> artifacts meta :last-modified)]
40-
(neg? (- millis-per-day (- (.getTime (java.util.Date.)) last-modified)))
40+
(neg? (- (long millis-per-day)
41+
(long (- (.getTime (java.util.Date.))
42+
(long last-modified)))))
4143
true)))
4244

4345
(defn- edn-read-or-nil

src/refactor_nrepl/core.clj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@
293293
(let [^clojure.lang.PersistentVector gen-class (some-> ns-form
294294
(get-ns-component :gen-class)
295295
vec)
296-
methods_index (inc (if-not (nil? gen-class)
297-
(.indexOf gen-class :methods)
298-
-1))]
296+
methods_index (if-not (nil? gen-class)
297+
(-> gen-class (.indexOf :methods) inc)
298+
0)]
299299
(if-not (zero? methods_index)
300300
(apply merge (map #(meta %) (nth gen-class methods_index)))
301301
nil)))
@@ -406,7 +406,9 @@
406406
"Guard the evaluation of `body` with a test on the current clojure version."
407407
{:style/indent 1}
408408
[{:keys [major minor] :as _clojure-version} & body]
409-
(when (or (> (:major *clojure-version*) major)
410-
(and (= (:major *clojure-version*) major)
411-
(>= (:minor *clojure-version*) minor)))
412-
`(do ~@body)))
409+
(let [major (long major)
410+
minor (long minor)]
411+
(when (or (> (-> *clojure-version* :major long) major)
412+
(and (= (-> *clojure-version* :major long) major)
413+
(>= (-> *clojure-version* :minor long) minor)))
414+
`(do ~@body))))

0 commit comments

Comments
 (0)