Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A little bit of pretty-printing sugar for the defproject

  • Loading branch information...
commit 78a6cbc6de1bd843b7e307b821905b0fc8585a59 1 parent 11a550f
Tom Faulhaber tomfaulhaber authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/leiningen/precate.clj
11 src/leiningen/precate.clj
View
@@ -130,6 +130,12 @@
(:name project))) ~(:version project)
~@(apply concat (dissoc project :name :group :version :root))))
+(defn pprint-project [project]
+ (pprint/with-pprint-dispatch pprint/code-dispatch
+ (pprint/cl-format true "~<(~;~a ~a ~s~^ ~1i~_~@<~@{~<~w~^ ~w~:>~^ ~_~}~:>~;)~:>~%"
+ (concat (take 3 project)
+ (list (partition 2 (drop 3 project)))))))
+
(defn precate
"Suggest a new project.clj that's compatible with Leiningen 2."
[project]
@@ -139,6 +145,5 @@
(println "This plugin is not intended for use on other plugins.")
(println "Please see https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md"))
(suggest-profiles)
- (pprint/with-pprint-dispatch pprint/code-dispatch ; kinda gross =\
- (pprint/pprint (project-map-to-defproject (suggest-project-map project))))
- (flush))
+ (pprint-project (project-map-to-defproject (suggest-project-map project)))
+ (flush))
Please sign in to comment.
Something went wrong with that request. Please try again.