Comments (5)
I get correct indents when I have zero aliases other than :kaocha
, but wrong indents when I have other aliases.
Good behavior:
$ cat deps.edn
{:deps {}}
$ neil-dev add kaocha
"adding kaocha"
If you wish to create a `bin/kaocha` file, copy and run the following:
mkdir -p bin && \
echo '#!/usr/bin/env bash
clojure -M:kaocha "$@"' > bin/kaocha && \
chmod +x bin/kaocha
$ cat deps.edn
{:deps {}
:aliases
{:kaocha ;; added by neil
{:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}}
:main-opts ["-m" "kaocha.runner"]}}}
Bad behavior:
$ cat deps.edn
{:deps {}
:aliases
{:dev {}}}
$ neil-dev add kaocha
"adding kaocha"
If you wish to create a `bin/kaocha` file, copy and run the following:
mkdir -p bin && \
echo '#!/usr/bin/env bash
clojure -M:kaocha "$@"' > bin/kaocha && \
chmod +x bin/kaocha
$ cat deps.edn
{:deps {}
:aliases
{:dev {}
:kaocha ;; added by neil
{:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}}
:main-opts ["-m" "kaocha.runner"]}}}
from neil.
babashka.neil/add-alias
appears to be the function to understand:
Lines 131 to 166 in 9a79582
from neil.
@borkdude I feel tempted to drop the previous logic that tried to compute the correct in favor of a dumb approach: repeatedly using rewrite-edn/assoc-in
, and accepting the result. If we go this way, newline behavior will change.
Code before and after
Previous add-alias
impl relies on a hard-coded 1
value for indention, which I think is causing problems:
Proposal: instead, assume the user already has a deps.edn
file they are okay with, and that we can add content from the new map by adding one key + value per line:
Behavior example
No existing deps.edn
file.
Existing behavior:
$ neil add kaocha
If you wish to create a `bin/kaocha` file, copy and run the following:
mkdir -p bin && \
echo '#!/usr/bin/env bash
clojure -M:kaocha "$@"' > bin/kaocha && \
chmod +x bin/kaocha
$ cat deps.edn
{:deps {}
:aliases
{:kaocha ;; added by neil
{:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}}
:main-opts ["-m" "kaocha.runner"]}}}
Proposed behavior:
$ rm deps.edn
$ neil-dev add kaocha
If you wish to create a `bin/kaocha` file, copy and run the following:
mkdir -p bin && \
echo '#!/usr/bin/env bash
clojure -M:kaocha "$@"' > bin/kaocha && \
chmod +x bin/kaocha
$ cat deps.edn
{:deps {}
:aliases {:kaocha {:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}}
:main-opts ["-m" "kaocha.runner"]}}}
Thoughts?
Would you like to keep the current newline behavior?
from neil.
Sounds good. Can you also test this with an already existing deps.edn file?
from neil.
Sounds good.
👍
Can you also test this with an already existing deps.edn file?
I will 👍
from neil.
Related Issues (20)
- Neil completely crashes on fresh install HOT 24
- `neil dep add` exits with code 0 on both failure and success HOT 1
- Neil new behaviour different for windows HOT 4
- NPE on `neil dep upgrade ` HOT 5
- suggestion: support `neil add nrepl -with-cider` HOT 3
- Documentation: add git as a requirement HOT 1
- Feature request: a flag that does what `dep search` already does, but works for multiple artifacts and outputs a string suitable for `-Sdeps` HOT 3
- Neil does not use the latest version of slipset/deps-deploy in the `neil add build` command
- suggestion: use DEPS_CLJ_TOOLS_DIR to detect DEPS_CLJ_TOOLS_VERSION HOT 2
- Newlines should be added when adding dependencies HOT 2
- Suggestion: Add human-readable output to `neil dep add` HOT 1
- `neil add` could provide usage help rather than crash HOT 2
- After merging #216, `neil add` produces super long lines for certain aliases HOT 4
- Allow "pinning" a dependency, so it is not changed on global "upgrade" HOT 2
- neil dep upgrade still upgrades git dep HOT 8
- neil dep upgrade inserts git/url into upgraded dep HOT 6
- neil dep upgrade changes git url HOT 4
- On expired `NEIL_GITHUB_TOKEN`, `neil dep upgrade` does nothing, then terminates with exit code 0 HOT 4
- `neil dep add` crashes if there's metadata on the `:deps` map
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neil.