clojure-emacs / clojure-emacs/clj-refactor.el

cljr-add-project-dependency document support for deps.edn

Open
#547 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
785
Forks
110
PR merge metrics
No merged PRs in 30d

Description

The docstring says `Add a dependency to the project.clj file.` so I thought it will only support lein, but I tried it on my deps.edn project and was pleasantly surprised it worked great :smile:
Maybe change the docstring to `Add a dependency to project.clj or deps.edn`?

Also could maybe improve the error message a little in the case where it doesn't find the project file, maybe in `cljr--add-project-dependency` change it to something like:
```
(if-let ((project-file (cljr--project-file))
(deps (cljr--project-with-deps-p project-file)))
(cljr--update-file project-file
...)
(error "no project file found"))
```
so it gives a clear error message with the reason rather than just nil isn't stringp in `cljr--project-with-deps-p`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.