`neil new` puts `:neil :project :name ,,,` indented behind `:aliases :build :nsdefault`
Hi!
When I run neil new mylib, I get this deps.edn:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
:aliases
{:test
{:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}}
:build {:deps {io.github.clojure/tools.build
{:git/tag "v0.9.2" :git/sha "fe6b140"}
slipset/deps-deploy {:mvn/version "0.2.0"}}
:ns-default build} :neil {:project {:name mylib/mylib}}}}
I'd prefer if :neil {:project {:name mylib/mylib}} was on its own line, like this:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
:aliases
{:test
{:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}}
:build {:deps {io.github.clojure/tools.build
{:git/tag "v0.9.2" :git/sha "fe6b140"}
slipset/deps-deploy {:mvn/version "0.2.0"}}
:ns-default build}
:neil {:project {:name mylib/mylib}}}}
Thoughts?
$ neil --version
neil 0.1.56
Log
I'm taking some notes as I go along. I don't want to create notifications for each edit, so I batch these together in the original post rather than create comments for each step.
2023-02-21
The call that puts :neil {:project {:name ,,,}} on the end of another line rather than on its own line appears to be:
(r/assoc-in nodes [:aliases :neil :project k] v)
https://github.com/babashka/neil/blob/65a078a24462ab06fc7bc3bd5e240f4adfaa7f8a/src/babashka/neil/project.clj#L29-L38
I'd prefer that too. Not sure why it happens, but might be something in borkdude/rewrite-edn as well. Feel free to have a peek!
Just noticed this too!
Feel free to post an issue + minimal repro at borkdude/rewrite-edn
I started to explore this with a Clerk notebook, but I didn't really get anywhere (no repro).
I believe the relevant neil function for this behavior is babashka.neil.project/assoc-project-meta!.
Happy to discuss in Slack if someone wants to give it a shot.
I mean a repro using rewrite-edn.
Made an issue now. I didn't understand what you meant at first --- that this is actually something rewrite-edn is meant to handle!