diff --git a/.travis.yml b/.travis.yml index 4e19ecc..7d2d176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,4 @@ script: - "lein test-all" jdk: - openjdk7 -- oraclejdk7 - oraclejdk8 diff --git a/kibit/src/kibit/replace.clj b/kibit/src/kibit/replace.clj index 6962d09..1bae8b6 100644 --- a/kibit/src/kibit/replace.clj +++ b/kibit/src/kibit/replace.clj @@ -71,11 +71,14 @@ (-> zipper rewrite.zip/node meta :row))) (recur (rewrite.zip/edit zipper (fn -replace-zipper [sexpr] - (vary-meta (:alt check-map) - (fn -remove-loc [m] - (dissoc m - :line - :column))))) + (let [alt (:alt check-map)] + (if (meta alt) + (vary-meta alt + (fn -remove-loc [m] + (dissoc m + :line + :column))) + alt)))) reporter kw-opts) zipper) diff --git a/kibit/test/kibit/test/replace.clj b/kibit/test/kibit/test/replace.clj index 017f499..9cd2182 100644 --- a/kibit/test/kibit/test/replace.clj +++ b/kibit/test/kibit/test/replace.clj @@ -21,6 +21,9 @@ '(inc a) '(+ 1 a) + '1 + '(do 1) + '(defn "Documentation" ^{:my-meta 1} [a] ;; a comment (inc a)) @@ -40,6 +43,9 @@ "(inc a)" "(+ 1 a)" + "1" + "(do 1)" + "(ns replace-file) (defn \"Documentation\" ^{:my-meta 1} [a]