This page describes development practices for this codebase.
To lint:
clojure -M:clj-kondo --lint src
We lint our Clojure(Script) code with https://github.com/clj-kondo/clj-kondo/. If you need to configure specific linters, see this documentation. Where possible, a global linting configuration is used and namespace specific configuration is avoided.
There are outstanding linting items that are currently ignored to allow linting the rest of the codebase in CI. These outstanding linting items should be addressed at some point:
TODO:lint
#_:clj-kondo/ignore
require a good understanding of the context to address as they usually involve something with a side effect or require changing multiple fns up the call stack.We have unit and end to end tests as described in https://github.com/logseq/logseq#5-run-tests.
When writing unit tests it is helpful to have tests automatically run on file
save with yarn shadow-cljs watch test --config-merge '{:autorun true}'
. The
test output may appear where shadow-cljs was first invoked e.g. where yarn
watch
is running. For more about the shadow-cljs test runner, see this
documentation.