Clojure Giant’s Shoulders
This repo is a bundle of tools and scripts I tend to reach for every time I start a new Clojure project. I hope you find it useful as a starting point for your projects too! Please feel free to delete any parts you don’t need or want, it’s just a suggestion and a place to begin.
I want to get you into a REPL as quickly as possible so you can start solving problems without worrying about the colour of the bike shed.
You can use any nREPL based Clojure editor plugins to talk to the REPL but I of course recommend my own, Conjure, if you’re not sure where to start. If you’re really new to Clojure and don’t fancy diving into Neovim then I’d probably recommend Calva.
Fork, copy, clone, borrow, read or browse. Do whatever you want with this repository and use it how you see fit.
Good luck, have fun!
Make sure you have a LSP client set up for your editor of choice and clojure-lsp installed for the best experience. This will enable extra tooling like linting, in editor formatting, completion and integration with function instrumentation schemas. You can have in editor type checking as you write your Clojure code if you set this up correctly.
Starts an interactive REPL with history, highlighting, completion and automatic documentation lookup as you type. Before you start working with the project you should run this in a terminal that you can keep safe in the background somewhere.
You can type code directly into this REPL but I’d recommend using a plugin for an editor of your choosing. It should connect to the REPL automatically when you open a Clojure file in this project thanks to the .nrepl-port
file.
You may also enable a portal window like so:
./scripts/repl :portal true
This will open a window alongside your REPL (or in your current browser window if you don’t have a Chrome / Chromium installed) that will allow you to visually inspect any values you wrap in (tap> …)
. Try it out by evaluating (tap> (range 10))
in the REPL with the portal window open.
Run the test suite with kaocha. Append --watch
to execute your tests as you change files.
I highly recommend keeping a ./scripts/kaocha --watch
window open beside your scripts/repl
window while you work.
Format all of your code with cljfmt.
Find and update dependencies with antq.
# Check for updates
./scripts/outdated
# Actually perform updates
./scripts/outdated --upgrade
Find the full unlicense in the UNLICENSE
file, but here’s a snippet.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.