Skip to content

Commit 7cd7ec6

Browse files
authored
Merge branch 'master' into master
2 parents 53aab9a + cfbfa3e commit 7cd7ec6

25 files changed

+284
-282
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pom.xml
66
pom.xml.asc
77
nashorn_code_cache
8+
out
89
*.jar
910
*.class
1011
.cljs_nashorn_repl

.travis.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,57 @@
1+
dist: xenial
12
language: clojure
2-
lein: 2.8.1
3-
sudo: false
3+
lein: 2.8.3
44
cache:
55
directories:
66
- $HOME/.m2
77
script:
88
- make $TARGET
99
env:
1010
matrix:
11-
- CLOJURE_VERSION=1.8 TARGET=test-clj
12-
- CLOJURE_VERSION=1.8 TARGET=test-cljs
13-
- CLOJURE_VERSION=1.9 TARGET=test-clj
14-
- CLOJURE_VERSION=1.9 TARGET=test-cljs
15-
- CLOJURE_VERSION=1.10 TARGET=test-clj
16-
- CLOJURE_VERSION=1.10 TARGET=test-cljs
11+
- CLOJURE_VERSION=1.8 TARGET='test smoketest'
12+
- CLOJURE_VERSION=1.9 TARGET='test smoketest'
13+
- CLOJURE_VERSION=1.10 TARGET='test smoketest'
14+
- CLOJURE_VERSION=master TARGET='test smoketest'
1715
global:
1816
- secure: "bCp4gU7XgeqLnqKwEpJarnKPbGljHyLE2rZnub4mEHD8kcvh6LoEkG/2QCtnSETj8zrQJwyMuEDGUwPgjmzQ/aEn6UiIYmv7ka6QnLBxOxhqQTbDtG7HssfkeT5b67LgOyQX7ejK88vnmH+OeWXM7kOOvUwVy5BVgsYyr2f1cGU="
1917
- secure: "D2Ie7dUZ9nQOIWtkRl2XWZeijSL8expUXP3GziSqQV1scJzwexxnUsRvWOkc2YU8+6IIGz9tcyt9RrEFUVF31VZgRSHh8P5rGGCzI2l99djKhYFfSErElwgoAJZFtOzougZK66/Gtb5uDo5L/wlKHkl4st3miqm+mEvfJITDjRQ="
2018
jdk:
21-
- oraclejdk8
19+
- openjdk8
2220
- openjdk11
21+
- openjdk-ea
2322
stages:
2423
- name: check
24+
jdk: openjdk11
2525
- name: test
26-
# Deploy only from the home repo where the credentials can be
27-
# properly decrypted. Never deploy from a pull request job.
28-
# In addition, ensure we're on the master branch (snapshots)
29-
# or a branch with semver naming (releases).
3026
- name: deploy
27+
jdk: openjdk11
28+
# Deploy only from the home repo where the credentials can be
29+
# properly decrypted. Never deploy from a pull request job.
30+
# In addition, ensure we're on the master branch (snapshots)
31+
# or a branch with semver naming (releases).
3132
if: repo = clojure-emacs/cider-nrepl
3233
AND type != pull_request
3334
AND ( branch = master OR branch =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ )
35+
3436
jobs:
3537
include:
36-
# Test OpenJDK against latest Clojure stable
37-
- env: CLOJURE_VERSION=1.10 TARGET=test-clj
38-
jdk: openjdk8
39-
- env: CLOJURE_VERSION=1.10 TARGET=test-cljs
40-
jdk: openjdk8
41-
42-
# Test Clojure master against a single JDK
43-
- env: CLOJURE_VERSION=master TARGET=test-clj
44-
jdk: openjdk11
45-
- env: CLOJURE_VERSION=master TARGET=test-cljs
46-
jdk: openjdk11
47-
48-
# Coverage analysis
49-
- env: CLOJURE_VERSION=1.10 TARGET=cloverage
50-
jdk: oraclejdk8
51-
after_success: bash <(curl -s https://codecov.io/bash) -f target/coverage/codecov.json
52-
53-
# Eastwood linter
5438
- stage: check
5539
env: CLOJURE_VERSION=1.10 TARGET=eastwood
56-
jdk: oraclejdk8
5740

58-
# Check cljfmt
5941
- stage: check
6042
env: CLOJURE_VERSION=1.10 TARGET=cljfmt
61-
jdk: oraclejdk8
6243

63-
# Deployment
44+
- stage: test
45+
env: CLOJURE_VERSION=1.10 TARGET=cloverage
46+
jdk: openjdk11
47+
after_success: bash <(curl -s https://codecov.io/bash) -f target/coverage/codecov.json
48+
6449
- stage: deploy
6550
env: TARGET=deploy
66-
jdk: oraclejdk8
6751

68-
fast_finish: true # don't wait for allowed failures before build finish
52+
matrix:
53+
fast_finish: true
6954
allow_failures:
70-
- env: CLOJURE_VERSION=master TARGET=test-clj
71-
- env: CLOJURE_VERSION=master TARGET=test-cljs
55+
- jdk: openjdk-ea
56+
- env: CLOJURE_VERSION=master TARGET='test smoketest'
7257
- env: CLOJURE_VERSION=1.10 TARGET=cloverage

Makefile

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
.PHONY: test-clj test-cljs eastwood cljfmt cloverage install smoketest release deploy clean detect_timeout
1+
.PHONY: test eastwood cljfmt cloverage install smoketest release deploy clean detect_timeout
22

33
CLOJURE_VERSION ?= 1.9
44
export CLOVERAGE_VERSION = 1.0.13
55

6-
# The test-cljs target needs to be modified if working with JDK9
76
JAVA_VERSION = $(shell lein with-profile +sysutils \
87
sysutils :java-version-simple | cut -d " " -f 2)
98

@@ -13,31 +12,17 @@ JAVA_VERSION = $(shell lein with-profile +sysutils \
1312

1413
source-deps: .source-deps
1514

16-
test-clj: .source-deps smoketest
17-
lein with-profile +$(CLOJURE_VERSION),+plugin.mranderson/config,+test-clj test
18-
19-
test-cljs: .source-deps
20-
lein with-profile +$(CLOJURE_VERSION),+plugin.mranderson/config,+test-cljs test
15+
test: .source-deps
16+
lein with-profile +$(CLOJURE_VERSION),+plugin.mranderson/config test
2117

2218
eastwood:
23-
lein with-profile +$(CLOJURE_VERSION),+test-clj,+test-cljs,+eastwood eastwood \
24-
"{:namespaces [:source-paths] :exclude-namespaces [cider-nrepl.plugin]}"
19+
lein with-profile +$(CLOJURE_VERSION),+eastwood eastwood
2520

2621
cljfmt:
27-
lein with-profile +$(CLOJURE_VERSION),+test-clj,+test-cljs,+cljfmt cljfmt check
28-
29-
30-
# Cloverage can't handle some of the code in this project. For now we
31-
# must filter problematic namespaces (`-e`) and tests (`-t`) from
32-
# instrumentation. Note: this means for now coverage reporting isn't
33-
# exact. See issue #457 for details.
22+
lein with-profile +$(CLOJURE_VERSION),+cljfmt cljfmt check
3423

3524
cloverage:
36-
lein with-profile +$(CLOJURE_VERSION),+test-clj,+cloverage cloverage --codecov \
37-
-e ".*java.parser" \
38-
-e "cider-nrepl.plugin" \
39-
-e ".*util.instrument" \
40-
-t "^((?!debug-integration-test).)*$$"
25+
lein with-profile +$(CLOJURE_VERSION),+cloverage cloverage
4126

4227
install: .source-deps
4328
lein with-profile +$(CLOJURE_VERSION),+plugin.mranderson/config install

eastwood.clj

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
(disable-warning
2-
{:linter :constant-test
3-
:if-inside-macroexpansion-of #{'clojure.test/is}
4-
:within-depth 1
5-
:reason "The `is` macro commonly expands to contain an `if` with a condition that is a constant."})
6-
7-
(disable-warning
8-
{:linter :constant-test
9-
:if-inside-macroexpansion-of #{'debugger.core/break}
2+
{:linter :unused-ret-vals
3+
:if-inside-macroexpansion-of #{'boot.core/deftask}
104
:within-depth 7
11-
:reason "The `break` macro commonly expands to contain an `if` with a condition that is a constant."})
5+
:reason "The `deftask` macro often includes calls to `boot.util/dbug*` whose purpose is solely for side-effects."})
126

137
(disable-warning
14-
{:linter :constant-test
15-
:if-inside-macroexpansion-of #{'clojure.core/cond->}
16-
:within-depth 2
17-
:reason "The `cond->` macro can legitimately contain always-true predicates."})
8+
{:linter :deprecations
9+
:symbol-matches #{#"^public boolean java\.lang\.reflect\.AccessibleObject\.isAccessible\(\)$"}
10+
:reason "The replacement, canAccess(Object), was added in JDK9 – but we still support JDK8."})
1811

1912
(disable-warning
20-
{:linter :unused-ret-vals
21-
:if-inside-macroexpansion-of #{'boot.core/deftask}
22-
:within-depth 7
23-
:reason "The `deftask` macro often includes calls to `boot.util/dbug*` whose purpose is solely for side-effects."})
13+
{:linter :deprecations
14+
:symbol-matches #{#"^public final void java\.lang\.Thread\.stop\(\)$"}})

project.clj

Lines changed: 71 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject cider/cider-nrepl "0.20.0"
1+
(defproject cider/cider-nrepl "0.20.1-SNAPSHOT"
22
:description "nREPL middlewares for CIDER"
33
:url "https://github.com/clojure-emacs/cider-nrepl"
44
:license {:name "Eclipse Public License"
@@ -13,7 +13,7 @@
1313
^:source-dep [compliment "0.3.8"]
1414
^:source-dep [cljs-tooling "0.3.1"]
1515
^:source-dep [cljfmt "0.6.1" :exclusions [org.clojure/clojurescript]]
16-
;; Not used directly in cider-nrepl, but needed because of tool.namespace
16+
;; Not used directly in cider-nrepl, but needed because of tools.namespace
1717
;; and the way MrAnderson processes dependencies
1818
;; See https://github.com/clojure-emacs/cider/issues/2176 for details
1919
^:source-dep [org.clojure/java.classpath "0.3.0"]
@@ -28,7 +28,9 @@
2828

2929
:filespecs [{:type :bytes :path "cider/cider-nrepl/project.clj" :bytes ~(slurp "project.clj")}]
3030

31-
:test-paths ["test/common"] ;; See `test-clj` and `test-cljs` profiles below.
31+
:source-paths ["src"]
32+
:resource-paths ["resources"]
33+
:test-paths ["test/clj" "test/cljs" "test/common"]
3234

3335
:test-selectors {:default (fn [test-meta]
3436
(let [parse-version (fn [v] (mapv #(Integer/parseInt (re-find #"\d+" %)) (clojure.string/split v #"\.")))
@@ -55,68 +57,82 @@
5557
:password :env/clojars_password
5658
:sign-releases false}]]
5759

58-
:profiles {:provided {:dependencies [[org.clojure/clojure "1.8.0"]]}
59-
60-
:dev {:repl-options {:nrepl-middleware [cider.nrepl/wrap-apropos
61-
cider.nrepl/wrap-classpath
62-
cider.nrepl/wrap-complete
63-
cider.nrepl/wrap-debug
64-
cider.nrepl/wrap-enlighten
65-
cider.nrepl/wrap-format
66-
cider.nrepl/wrap-info
67-
cider.nrepl/wrap-inspect
68-
cider.nrepl/wrap-macroexpand
69-
cider.nrepl/wrap-ns
70-
cider.nrepl/wrap-out
71-
cider.nrepl/wrap-content-type
72-
cider.nrepl/wrap-slurp
73-
cider.nrepl/wrap-pprint-fn
74-
cider.nrepl/wrap-profile
75-
cider.nrepl/wrap-refresh
76-
cider.nrepl/wrap-resource
77-
cider.nrepl/wrap-spec
78-
cider.nrepl/wrap-stacktrace
79-
cider.nrepl/wrap-test
80-
cider.nrepl/wrap-trace
81-
cider.nrepl/wrap-tracker
82-
cider.nrepl/wrap-undef
83-
cider.nrepl/wrap-version]}
84-
:dependencies [;; For developing the Leiningen plugin.
85-
[leiningen-core "2.8.2"]
86-
;; For the boot tasks namespace
87-
[boot/base "2.8.2"]
88-
[boot/core "2.8.2"]]}
60+
:profiles {:provided [:1.8]
61+
62+
:dev {:dependencies [[boot/base "2.8.2"]
63+
[boot/core "2.8.2"]
64+
[leiningen-core "2.8.3"]]}
8965

9066
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]
91-
[org.clojure/clojurescript "1.8.51" :scope "provided"]]}
67+
[org.clojure/clojurescript "1.8.51" :scope "provided"]
68+
[javax.xml.bind/jaxb-api "2.3.1" :scope "provided"]]}
9269
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]
93-
[org.clojure/clojurescript "1.9.946" :scope "provided"]]
70+
[org.clojure/clojurescript "1.9.946" :scope "provided"]
71+
[javax.xml.bind/jaxb-api "2.3.1" :scope "provided"]]
72+
;; TODO: Merge the tests in this dir in to test/clj once we
73+
;; drop support for Clojure 1.8
9474
:test-paths ["test/spec"]}
9575
:1.10 {:dependencies [[org.clojure/clojure "1.10.0"]
96-
[org.clojure/clojurescript "1.10.439" :scope "provided"]]
76+
[org.clojure/clojurescript "1.10.63" :scope "provided"]]
9777
:test-paths ["test/spec"]}
9878
:master {:repositories [["snapshots" "https://oss.sonatype.org/content/repositories/snapshots"]]
9979
:dependencies [[org.clojure/clojure "1.11.0-master-SNAPSHOT"]
10080
[org.clojure/clojurescript "1.10.439" :scope "provided"]]}
10181

102-
:test-clj {:source-paths ["test/src"]
103-
:java-source-paths ["test/java"]
104-
:resource-paths ["test/resources"]
105-
:test-paths ["test/clj"]}
106-
:test-cljs {:test-paths ["test/cljs"]
107-
:dependencies [[cider/piggieback "0.3.10"]
108-
[javax.xml.bind/jaxb-api "2.3.1"]]}
82+
:test {:source-paths ["test/src"]
83+
:java-source-paths ["test/java"]
84+
:resource-paths ["test/resources"]
85+
:dependencies [[cider/piggieback "0.3.10"]]}
86+
87+
;; Need ^:repl because of: https://github.com/technomancy/leiningen/issues/2132
88+
:repl ^:repl [:test
89+
{:repl-options {:nrepl-middleware [cider.nrepl/wrap-apropos
90+
cider.nrepl/wrap-classpath
91+
cider.nrepl/wrap-complete
92+
cider.nrepl/wrap-content-type
93+
cider.nrepl/wrap-debug
94+
cider.nrepl/wrap-enlighten
95+
cider.nrepl/wrap-format
96+
cider.nrepl/wrap-info
97+
cider.nrepl/wrap-inspect
98+
cider.nrepl/wrap-macroexpand
99+
cider.nrepl/wrap-ns
100+
cider.nrepl/wrap-out
101+
cider.nrepl/wrap-pprint-fn
102+
cider.nrepl/wrap-profile
103+
cider.nrepl/wrap-refresh
104+
cider.nrepl/wrap-resource
105+
cider.nrepl/wrap-slurp
106+
cider.nrepl/wrap-spec
107+
cider.nrepl/wrap-stacktrace
108+
cider.nrepl/wrap-test
109+
cider.nrepl/wrap-trace
110+
cider.nrepl/wrap-tracker
111+
cider.nrepl/wrap-undef
112+
cider.nrepl/wrap-version]}}]
109113

110114
:sysutils {:plugins [[lein-sysutils "0.2.0"]]}
111115

112-
:cloverage {:plugins [[lein-cloverage "1.0.13"]]}
113-
114-
:cljfmt {:plugins [[lein-cljfmt "0.6.1"]]
115-
:cljfmt {:indents {as-> [[:inner 0]]
116-
with-debug-bindings [[:inner 0]]
117-
merge-meta [[:inner 0]]
118-
try-if-let [[:block 1]]
119-
if-class [[:block 1]]}}}
120-
121-
:eastwood {:plugins [[jonase/eastwood "0.3.4"]]
122-
:eastwood {:config-files ["eastwood.clj"] :exclude-namespaces [cider-nrepl.plugin cider.tasks cider.nrepl.test-session]}}})
116+
:cloverage [:test
117+
{:plugins [[lein-cloverage "1.0.13"]]
118+
:cloverage {:codecov? true
119+
;; Cloverage can't handle some of the code
120+
;; in this project; see issue #457
121+
:ns-exclude-regex [#".*util.instrument"]
122+
:test-ns-regex [#"^((?!debug-integration-test).)*$$"]}}]
123+
124+
:cljfmt [:test
125+
{:plugins [[lein-cljfmt "0.6.1"]]
126+
:cljfmt {:indents {as-> [[:inner 0]]
127+
with-debug-bindings [[:inner 0]]
128+
merge-meta [[:inner 0]]
129+
try-if-let [[:block 1]]
130+
if-class [[:block 1]]}}}]
131+
132+
:eastwood [:test
133+
{:plugins [[jonase/eastwood "0.3.4"]]
134+
:eastwood {:config-files ["eastwood.clj"]
135+
;; TODO: Add :test-paths once
136+
;; https://github.com/jonase/eastwood/issues/298
137+
;; is resolved
138+
:namespaces [:source-paths]}}]})

src/cider/nrepl.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@
259259
{:doc "Sets the page size in paginated view to specified value."
260260
:requires {"page-size" "New page size."
261261
"session" "The current session"}
262+
:returns {"status" "\"done\""}}
263+
"inspect-clear"
264+
{:doc "Clears the state state of the inspector."
265+
:requires {"session" "The current session"}
262266
:returns {"status" "\"done\""}}}}))
263267

264268
(def-wrapper wrap-macroexpand cider.nrepl.middleware.macroexpand/handle-macroexpand

src/cider/nrepl/middleware/content_type.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@
106106

107107
(instance? java.awt.Image value)
108108
(with-open [bos (ByteArrayOutputStream.)]
109-
(ImageIO/write ^Image value "png" ^OutputStream bos)
110109
(merge response
111-
(slurp-reply "" ["image/png" {}] (.toByteArray bos))))
110+
(when (ImageIO/write ^Image value "png" ^OutputStream bos)
111+
(slurp-reply "" ["image/png" {}] (.toByteArray bos)))))
112112

113113
:else response))
114114

src/cider/nrepl/middleware/inspect.clj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
(defn set-page-size-reply [msg]
8686
(inspector-response msg (swap-inspector! msg inspect/set-page-size (:page-size msg))))
8787

88+
(defn clear-reply [msg]
89+
(inspector-response msg (swap-inspector! msg (constantly (inspect/fresh)))))
90+
8891
(defn handle-inspect [handler msg]
8992
(if (= (:op msg) "eval")
9093
(eval-reply handler msg)
@@ -96,4 +99,5 @@
9699
"inspect-get-path" get-path-reply
97100
"inspect-next-page" next-page-reply
98101
"inspect-prev-page" prev-page-reply
99-
"inspect-set-page-size" set-page-size-reply)))
102+
"inspect-set-page-size" set-page-size-reply
103+
"inspect-clear" clear-reply)))

src/cider/nrepl/middleware/track_state.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
(defn- var-meta-with-fn
2323
"Like clojure.core/meta but adds {:fn true} for functions and macros.
2424
Should only be used for vars."
25-
[var]
26-
(cond-> (meta var)
27-
(or (fn? @var) (instance? MultiFn @var)) (assoc :fn true)))
25+
[the-var]
26+
(cond-> (meta the-var)
27+
(or (fn? @the-var) (instance? MultiFn @the-var)) (assoc :fn true)))
2828

2929
(defn filter-core-and-get-meta
3030
"Remove keys whose values are vars in the core namespace."

0 commit comments

Comments
 (0)