Hacking on cider-nrepl

Hacking on cider-nrepl requires nothing but a bit of knowledge of Clojure and nREPL. In this section we’ll take a look at some practical tips to make you more productive while working on the project.

Makefile

cider-nrepl is built with tools.deps. It has to deal with multiple versions of Clojure and ClojureScript, plus dependency inlining with Mr. Anderson, which means a fair number of aliases and build steps. That’s why we’ve added a good old Makefile to save you the trouble of remembering them and just focus on the tasks at hand.

Obviously you can still invoke the underlying clojure commands directly, but you won’t have to do this most of the time.

Testing your changes

You’ve got several options for doing this:

  • Installing a snapshot of your work recently and doing tests against it (e.g. with make install).

  • Relying solely on the unit tests. You better write good unit tests, though!

  • Spinning new versions of nREPL from the REPL, and connecting some client to them to test your changes.

  • If you’re already using a client that depends on cider-nrepl (e.g. CIDER) making changes to the cider-nrepl code will normally result in those changes becoming immediately available to your client.

Running the tests

Just do:

$ make test

This runs against the real (non-inlined) dependencies, which is what you want most of the time. To run the suite against the mranderson-inlined sources (what gets published), use make inlined-test. By default the tests are run against the most recent Clojure version that’s supported.

Linting

cider-nrepl uses eastwood and cljfmt. Make sure your changes conform to the project’s baseline by doing:

$ make eastwood
$ make cljfmt

Releasing

Releases are cut from git tags. First prepare the release locally:

$ PROJECT_VERSION=x.y.z make release

This rolls the changelog over to the new version (dated today), bumps the cider-nrepl version in the usage docs, commits the result and creates the vx.y.z tag. Review the commit, then push it:

$ git push origin HEAD vx.y.z

Pushing the tag triggers CI, which runs make deploy to inline the shaded dependencies and publish the artifact to Clojars. Don’t deploy locally; doing so skips the checks CI performs.