babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
360 stars 26 forks source link

Newlines should be added when adding dependencies #209

Closed borkdude closed 4 months ago

borkdude commented 4 months ago

Sure, here is a (hopefully) reproducible steps:

  1. Run docker run --rm -it --platform linux/amd64 homebrew/brew:4.2.15 /bin/bash
  2. Install neil and java: brew install babashka/brew/neil, brew install java.
  3. echo {:deps {}} > deps.edn
  4. neil add dep com.s-exp/hirundo
  5. neil add dep metosin/malli
  6. cat deps.edn

In my m1 max mac, step 3 ~ 6 in a tmp/xx folder will suffice to reproduce it. I added step 1 and 2 for better reproducibility.

Originally posted by @zhming0 in https://github.com/babashka/neil/discussions/208#discussioncomment-8901760

borkdude commented 4 months ago

A repro purely with rewrite-edn:

 (-> (e/parse-string "{}") (e/assoc-in [:deps 'org.clojure/clojure] {:mvn/version "1.10.2"}) str e/parse-string (e/assoc-in [:deps 'org.foo/foo :mvn/version] "1.10.2") str)
;; => 
"{:deps {org.clojure/clojure {:mvn/version \"1.10.2\"} org.foo/foo {:mvn/version \"1.10.2\"}}}"
borkdude commented 4 months ago

Also reported here: https://github.com/borkdude/rewrite-edn/issues/36