Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure there's a leading : when using cider-clojure-cli-aliases #3426

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- [#3419](https://github.com/clojure-emacs/cider/issues/3419): Also match friendly sessions based on the buffer's ns form.
- `cider-test`: only show diffs for collections.
- [#3375](https://github.com/clojure-emacs/cider/pull/3375): `cider-test`: don't render a newline between expected and actual, most times.
- Ensure there's a leading `:` when using `cider-clojure-cli-aliases`.
- Improve `nrepl-dict` error reporting.
- Bump the injected `piggieback` to [0.5.3](https://github.com/nrepl/piggieback/blob/0.5.3/CHANGES.md#053-2021-10-26).
- Bump the injected `cider-nrepl` to [0.36.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.36.0/CHANGELOG.md#0360-2023-08-21).
Expand Down
5 changes: 4 additions & 1 deletion cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ your aliases contain any mains, the cider/nrepl one will be the one used."
(if cider-clojure-cli-aliases
;; remove exec-opts flags -A -M -T or -X from cider-clojure-cli-aliases
;; concatenated with :cider/nrepl to ensure :cider/nrepl comes last
(format "%s" (replace-regexp-in-string "^-\\(A\\|M\\|T\\|X\\)" "" cider-clojure-cli-aliases))
(let ((stripped (format "%s" (replace-regexp-in-string "^-\\(A\\|M\\|T\\|X\\)" "" cider-clojure-cli-aliases))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just name this alias.

(if (string-prefix-p ":" stripped)
stripped
(concat ":" stripped)))
"")
(if params (format " %s" params) ""))))

Expand Down
2 changes: 1 addition & 1 deletion dev/tramp-sample-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This way, for development purposes, we can SSH into it with TRAMP and exercise C
To get started:

* In one terminal tab, run `make run` to run the Docker image
* Once it's ready, from another tab, run `make ssh`
* Once it's ready, from another tab, run `make ssh` and start a repl manually from there
* The password is `cider`
* `cd /usr/src/app; lein repl :headless :host 0.0.0.0 :port 7888`

Expand Down
8 changes: 7 additions & 1 deletion test/cider-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,13 @@
(let ((cider-clojure-cli-aliases ":test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(describe "should strip out leading exec opts -A -M -T -X"
(describe "should strip out leading exec opts -A -M -T -X, and ensure there's a leading :"
(let ((cider-clojure-cli-aliases ":test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(let ((cider-clojure-cli-aliases "test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(let ((cider-clojure-cli-aliases "-A:test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
Expand Down