Skip to content

Commit f72099f

Browse files
committed
Update libs tests
Adapt to changes: - antq is now using rewrite-clj v1 - rewrite-edn is now using rewrite-clj v1 Add - test-doc-blocks which uses rewrite-clj v1 Remove - update-leiningen-dependencies-skill - library is failing and not due to rewrite-clj v1 Script now summarizes notes in a separate table to avoid extra wide output. Also add section to README on what projects are using rewrite-clj.
1 parent 7c99bbd commit f72099f

File tree

3 files changed

+68
-73
lines changed

3 files changed

+68
-73
lines changed

README.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,36 @@ See https://github.com/clj-commons/rewrite-clj/projects/1[project page for curre
4242
** link:doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc[Merging rewrite-clj and rewrite-cljs]
4343
* link:doc/03-faq.adoc[FAQ]
4444

45+
== Used In...
46+
47+
Some projects using rewrite-clj v1
48+
49+
* https://github.com/liquidz/antq[antq] ^t^
50+
* https://github.com/borkdude/carve[carve] ^t^ (in dev)
51+
* https://github.com/clojure-lsp/clojure-lsp[clojure-lsp] ^t^ (in dev)
52+
* https://github.com/borkdude/rewrite-edn[rewrite-edn] ^t^
53+
* https://github.com/lread/test-doc-blocks[test-doc-blocks]
54+
55+
Some projects using rewrite-clj v0 and/or rewrite-cljs
56+
57+
* https://github.com/mauricioszabo/atom-chlorine[atom-chlorine]
58+
* https://github.com/weavejester/cljfmt[cljfmt] ^t^
59+
* https://github.com/greglook/cljstyle[cljstyle]
60+
* https://github.com/Olical/depot[depot]
61+
* https://github.com/jonase/kibit[kibit]
62+
* https://github.com/xsc/lein-ancient[lein-ancient]
63+
* https://github.com/benedekfazekas/mranderson[mranderson] ^t^
64+
* https://github.com/jstepien/mutant[mutant]
65+
* https://github.com/juxt/pack.alpha[pack (alpha)]
66+
* https://github.com/clojure-emacs/refactor-nrepl[refactor-nrepl] ^t^
67+
* https://github.com/mauricioszabo/repl-tooling[repl-tooling]
68+
* https://github.com/atomist-skills/update-leiningen-dependencies-skill[update-leiningen-dependencies-skill]
69+
* https://github.com/kkinnear/zprint[zprint] ^t^
70+
71+
Have an update? Let us know!
72+
73+
^t^ [.small]#included in rewrite-clj v1 link:doc/02-developer-guide.adoc#libs-test[lib test suite]#
74+
4575
== Versioning
4676

4777
Rewrite-clj versioning scheme is: `major`.`minor`.`patch`-`test-qualifier`

doc/02-developer-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Current libs we test against:
219219
* mranderson
220220
* rewrite-edn
221221
* refactor-nrepl
222-
* update-leiningen-dependencies-skill
222+
* test-doc-blocks
223223
* zprint
224224

225225
Additional libs are welcome.

script/libs_tests.clj

Lines changed: 37 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@
151151
:removals (str removals)
152152
:additions (str additions)]))
153153

154+
;;
155+
;; Generic patch for deps.edn rewrite-clj v1 projects
156+
;;
157+
(defn deps-edn-v1-patch [{:keys [home-dir rewrite-clj-version]}]
158+
(patch-deps {:filename (str (fs/file home-dir "deps.edn"))
159+
:removals #{'rewrite-clj 'rewrite-clj/rewrite-clj}
160+
:additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}})
161+
(patch-rewrite-cljc-sources home-dir))
162+
154163
;;
155164
;; antq
156165
;;
@@ -223,31 +232,6 @@
223232
"[$1 :exclusions [rewrite-clj rewrite-cljs]]")
224233
(->> (spit p)))))
225234

226-
;;
227-
;; rewrite-edn
228-
;;
229-
;;
230-
(defn rewrite-edn-patch [{:keys [home-dir rewrite-clj-version]}]
231-
(patch-deps {:filename (str (fs/file home-dir "deps.edn"))
232-
:removals #{'lread/rewrite-cljc}
233-
:additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}})
234-
(patch-rewrite-cljc-sources home-dir))
235-
236-
;;
237-
;; update-leiningen-dependencies-skill
238-
;;
239-
240-
(defn- update-leiningen-dependencies-skill-patch [{:keys [home-dir rewrite-clj-version]}]
241-
(patch-deps {:filename (str (fs/file home-dir "deps.edn"))
242-
:removals #{'rewrite-cljs}
243-
:additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}}))
244-
245-
(defn- update-leiningen-dependencies-skill-prep [{:keys [home-dir]}]
246-
(status/line :detail "=> Installing node deps")
247-
(shcmd ["npm" "ci"] {:dir home-dir})
248-
(status/line :detail "=> Running tests as recommended, but this cmd always exits with 0, so consider this a prep step")
249-
(shcmd ["npm" "run" "test"] {:dir home-dir}))
250-
251235
;;
252236
;; zprint
253237
;;
@@ -296,10 +280,10 @@
296280
;;
297281

298282
(def libs [{:name "antq"
299-
:version "0.11.2"
283+
:version "0.12.0"
300284
:platforms [:clj]
301285
:github-release {:repo "liquidz/antq"}
302-
:patch-fn antq-patch
286+
:patch-fn deps-edn-v1-patch
303287
:show-deps-fn cli-deps-tree
304288
:test-cmds [["clojure" "-M:dev:test"]]}
305289
{:name "carve"
@@ -322,7 +306,7 @@
322306
{:name "clojure-lsp"
323307
:platforms [:clj]
324308
:version "2021.03.06-17.05.35"
325-
:github-release {:repo "clojure-lsp/clojure-lsp" }
309+
:github-release {:repo "clojure-lsp/clojure-lsp"}
326310
:patch-fn clojure-lsp-patch
327311
:show-deps-fn lein-deps-tree
328312
:test-cmds [["lein" "test"]]}
@@ -335,12 +319,13 @@
335319
:patch-fn mranderson-patch
336320
:show-deps-fn lein-deps-tree
337321
:test-cmds [["lein" "test"]]}
338-
{:name "rewrite-edn"
339-
:version "665f61cf273c79b44baacb0897d72c2157e27b09"
322+
{;; has a release on clojars but no release in GitHub repo
323+
:name "rewrite-edn"
324+
:version "8f75cf124984c6c4494df93ce10359de8beb588d"
340325
:platforms [:clj]
341326
:github-release {:repo "borkdude/rewrite-edn"
342327
:via :sha}
343-
:patch-fn rewrite-edn-patch
328+
:patch-fn deps-edn-v1-patch
344329
:show-deps-fn cli-deps-tree
345330
:test-cmds [["clojure" "-M:test"]]}
346331
{:name "refactor-nrepl"
@@ -353,28 +338,27 @@
353338
:show-deps-fn lein-deps-tree
354339
:prep-fn refactor-nrepl-prep
355340
:test-cmds [["lein" "with-profile" "+1.10,+plugin.mranderson/config" "test"]]}
356-
{:name "update-leiningen-dependencies-skill"
357-
:version "21c7ce794c83d6eed9c2a27e2fdd527b5da8ebb3"
358-
:platforms [:cljs]
359-
:github-release {:repo "atomist-skills/update-leiningen-dependencies-skill"
360-
:via :sha}
361-
:patch-fn update-leiningen-dependencies-skill-patch
362-
:prep-fn update-leiningen-dependencies-skill-prep
341+
{:name "test-doc-blocks"
342+
:version "1.0.114-alpha"
343+
:platforms [:clj :cljs]
344+
:note "generates tests under clj, but can also be run under cljs"
345+
:github-release {:repo "lread/test-doc-blocks"
346+
:version-prefix "v"}
347+
:patch-fn deps-edn-v1-patch
363348
:show-deps-fn cli-deps-tree
364-
:test-cmds [;; running tests a 2nd time via node to get non-zero exit code on failure
365-
["node" "tests.js"]]}
349+
:test-cmds [["bb" "./script/ci_tests.clj"]]}
366350
{:name "zprint"
367351
:version "1.1.1"
368352
:platforms [:clj :cljs]
369353
:note "zprint src hacked to pass with rewrite-clj v1"
370354
:github-release {:repo "kkinnear/zprint"}
371355
:patch-fn zprint-patch
372356
:prep-fn zprint-prep
373-
:show-deps-fn (fn [lib]
374-
(status/line :detail "=> Deps for Clojure run:")
375-
(lein-deps-tree lib)
376-
(status/line :detail "=> Deps Clojurescript run:")
377-
(cli-deps-tree lib))
357+
:show-deps-fn (fn [lib]
358+
(status/line :detail "=> Deps for Clojure run:")
359+
(lein-deps-tree lib)
360+
(status/line :detail "=> Deps Clojurescript run:")
361+
(cli-deps-tree lib))
378362
:test-cmds [["lein" "with-profile" "expectations" "test"]
379363
["clojure" "-M:cljs-runner"]]}])
380364

@@ -436,6 +420,13 @@
436420
(-> (doric/table [:name :version :available-version] outdated-libs) println)
437421
(status/line :detail "=> All libs seems up to date"))))
438422

423+
(defn- print-results [results]
424+
(status/line :info "Summary")
425+
(println (doric/table [:name :version :platforms :exit-codes] results))
426+
(when (seq (filter :note results))
427+
(status/line :detail "Notes")
428+
(println (doric/table [:name :note] (filter :note results)))))
429+
439430
(defn run-tests [requested-libs]
440431
(status/line :info "Testing 3rd party libs")
441432
(status/line :detail "Test popular 3rd party libs against current rewrite-clj.")
@@ -448,8 +439,7 @@
448439
:target-root-dir target-root-dir
449440
:rewrite-clj-version rewrite-clj-version))
450441
requested-libs))]
451-
(status/line :info "Summary")
452-
(println (doric/table [:name :version :platforms :note :exit-codes] results))
442+
(print-results results)
453443
(System/exit (if (->> results
454444
(map :exit-codes)
455445
flatten
@@ -489,28 +479,3 @@ Specifying no lib-names selects all libraries.")
489479
(status/fatal docopt-usage)))
490480

491481
(main *command-line-args*)
492-
493-
494-
#_(-> (curl/get "https://api.github.com/repos/borkdude/rewrite-edn/releases")
495-
:body
496-
(json/parse-string true)
497-
#_#_first
498-
:tag_name)
499-
500-
#_(-> (curl/get "https://api.github.com/repos/borkdude/rewrite-edn/git/refs/heads/master")
501-
:body
502-
(json/parse-string true)
503-
:object
504-
:sha)
505-
506-
#_(-> (curl/get "https://api.github.com/repos/weavejester/cljfmt/tags")
507-
:body
508-
(json/parse-string true)
509-
first)
510-
511-
#_(get-current-version (nth libs 5))
512-
513-
514-
#_(docopt/docopt docopt-usage
515-
*command-line-args*
516-
(fn [arg-map] arg-map))

0 commit comments

Comments
 (0)