From 6be43fb0401241314cf5eb957ec1a2624b3b8078 Mon Sep 17 00:00:00 2001 From: James Brennan Date: Sun, 3 Apr 2016 19:15:53 -0700 Subject: [PATCH] Suggest vary-meta in place of `(with-meta a (f (meta a) ,,,))` --- src/kibit/rules/misc.clj | 3 ++- test/kibit/test/misc.clj | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kibit/rules/misc.clj b/src/kibit/rules/misc.clj index 7ab6626..b2eab3c 100644 --- a/src/kibit/rules/misc.clj +++ b/src/kibit/rules/misc.clj @@ -103,7 +103,8 @@ ;; Other - [(not (some ?pred ?coll)) (not-any? ?pred ?coll)]) + [(not (some ?pred ?coll)) (not-any? ?pred ?coll)] + [(with-meta ?x (?f (meta ?x) . ?arg)) (vary-meta ?x ?f . ?arg)]) (comment diff --git a/test/kibit/test/misc.clj b/test/kibit/test/misc.clj index 3dbbf51..ca8037b 100644 --- a/test/kibit/test/misc.clj +++ b/test/kibit/test/misc.clj @@ -41,4 +41,6 @@ '(form arg) '(->> arg form) '(:form arg) '(->> arg :form) '(first-of-form rest-of-form arg) '(->> arg (first-of-form rest-of-form)) - '(not-any? pred coll) '(not (some pred coll)))) + '(not-any? pred coll) '(not (some pred coll)) + '(vary-meta arg f) '(with-meta arg (f (meta arg))) + '(vary-meta arg f :a :b :c) '(with-meta arg (f (meta arg) :a :b :c))))