cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
Eamonn Sullivan 2020-10-29T10:57:28.309800Z

Hi all, I think I've asked this question before, but I can't remember how I fixed it. I have a https://github.com/eamonnsullivan/github-api-lib that loads fine in Cider and I can run tests for namespaces (C-c , n), but when I try to run all of the project's tests, I get No assertions (or no tests) were run.Did you forget to use 'is' in your tests?. They run fine from the CLI (`clojure -M:test:runner`). What is cider looking for and isn't finding?

practicalli-john 2020-10-29T11:04:43.314100Z

@eamonn.sullivan the cider test runner will run tests evaluated in the repl. Test runners (:test/runner) will run the tests by reading all the source code files. When using the cider test runner I typically evaluate the test code in the REPL first. In Spacemacs a wrapper was added to evaluate the current namespace before calling cider test runner, so running cider-test-run-all-tests command from the *_test.clj file usually loaded all the tests.

Eamonn Sullivan 2020-10-29T11:08:05.314200Z

I do the same, but even if I evaluate all of the tests and code (C-c C-k) on every file, cider still doesn't run the project tests. It's not a huge deal. I just like that happy little feeling to see all of the assertions passing, but the important ones are about the code I'm currently modifying...

Eamonn Sullivan 2020-10-29T11:14:30.314400Z

C-c , l (run loaded tests) also fails with the same error, even when all of the tests are loaded. I'm pretty sure there was some way to set up the aliases to get this to work...

2020-10-29T12:14:33.315600Z

hmm... I seem to be having a problem with emacs taking ~100% cpu and hanging while trying to debug some code. Is anyone else having a similar issue? (it might just be b/c the function is horrible, but if it wasn't so ugly I wouldn't need the debugger 😄 )

2020-10-29T12:15:48.316300Z

I'm getting a Syn nREPL request timed out and my emacs locks up nicely. I'm running the latest from MELPA on emacs 27.1

2020-10-29T12:16:10.316700Z

(I'm presuming it is me which is why I'm asking first)

practicalli-john 2020-10-29T12:59:49.319500Z

@otfrom I assume you are using o from the debug menu if you need to step over any infinite lazy sequences, eg. (range). Thats the only time I recall blowing up emacs with cider debug.

2020-10-29T13:01:29.320400Z

debugging a much shorter function seems to work. I'll need to remember to step over the lazy seqs (esp the infinite ones)

2020-10-29T13:01:34.320600Z

thx @jr0cket

practicalli-john 2020-10-29T13:32:49.320700Z

I learnt by forgetting to do this many times 🙂

2020-10-29T13:33:59.322Z

one thing (that I'm pretty sure is a config thing) is that when I am debugging, I get the truncated value in the src window where I'm stepping through, but I get a much larger single line value that goes to *Messages*, which then slows down all of emacs due to the long lines bug. Is there a way to turn this off?

2020-10-29T13:35:05.322700Z

I know I can delete the buffer (same as I know how to clear the repl buffer), but I'd like to stop it from happening

practicalli-john 2020-10-29T13:35:07.322800Z

I assume the alias used which cider-jack-in or when starting the repl externally, includes :extra-paths ["test"] I include the following alias in my ~/.clojure/deps.edn

:env/dev
  {:extra-paths ["dev"]} 
https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L80-L82

practicalli-john 2020-10-29T13:40:59.323800Z

@otfrom I assume its probably one of these Cider variables... https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html

2020-10-29T13:44:27.324200Z

I'm having a look at that now. I'm wondering if it is the minibuffer bit of the overlay

2020-10-29T14:49:15.326100Z

hmm... I can't find a way to get at this. I've limited the overlay to only show at the end of the line, not the mini-buffer, I've changed the print quota to 160. Had a look through the docs and the issues and I can't find a way to limit printing of large data structures (not infinite, but big) in *Messages*

2020-10-29T14:53:16.326300Z

not quite sure what to do next

2020-10-29T16:00:19.326700Z

I'm solving the debugging problem by just rewriting the horrible code

👍 2
2020-10-29T20:21:22.329Z

cider and cljfmt seem to be in accord. I now work for a company that uses cljstyle, and sadly cider/cljfmt and cljstyle have indentation differences. Besides using a after-save-hook has anyone reconciled these unfortunate differences in a way they could live with?

dpsutton 2020-10-29T20:22:52.329600Z

clojure-mode has a few different settings for indentation. ideally you can get clojure-mode to indent in the way you like and then put them in a dir locals file for your work repo

2020-10-29T20:30:53.330300Z

Thanks, will probably have to create a lot of dir locals files 😀

dpsutton 2020-10-29T20:34:58.331Z

you should only (or hopefully) need only a single one. put it at the root of your directory structure and it will cascade to any file in that tree

👍 2