Clojure tools for Vis: zprint and cljfmt formatting, clj-kondo lint, reader syntax checks, test runs and an nREPL.
vis-agent extension install blockether/vis-lang-clojure --subdirectory extension --global --trust
Install the Clojure CLI and put it and a JDK on
PATH. The first tool call fetches the library from Clojars. Syntax checks and repairs do not
need the CLI or the JDK. Use Vis 0.2.53 or later for toolchain grants.
Use vis-agent set runtime python or vis-agent set runtime babashka before you
install the extension. Vis installs the implementation for that runtime. Both
implementations use the Clojure CLI and a JDK. The Babashka implementation does
not use Python.
In a Babashka session, for example, run:
(clj/run-tests {:paths ["test/app/core_test.clj::adds"]})
Both runtimes check delimiters before repl_eval. The Python implementation
also checks changed Clojure files through its edit hooks. Babashka does not run
these hooks. Use a version of Vis that supports Clojure and JDK read grants
for Babashka extension processes. An alternate VIS_LANG_CLOJURE_COMMAND must
also handle the repl-check request before Babashka can evaluate REPL code.
| Tool | Purpose |
|---|---|
clj.format_code | Format files or a snippet. Set is_written=True to write the changes. |
clj.lint_code | Run clj-kondo and report reflection warnings as failures. |
clj.run_tests | Run project tests. Set coverage=True to get coverage for Lazytest. |
clj.repl_start | Start a project nREPL for this session. |
clj.repl_status | Check if the project's REPL is active. |
clj.repl_connect | Attach to an nREPL that is already active. |
clj.repl_eval | Evaluate Clojure in the active REPL. |
clj.repl_stop | Stop a managed nREPL or detach from an external nREPL. |
clj.run_tests(["test/app/core_test.clj::adds"])
Edit hooks check changed files and repair structural errors when safe. See the Clojure toolchain reference for supported test runners, syntax checks and classpath details. Results follow the language contract.
From the repository root, run the Clojure tests. Then run the Python tests from extension/:
clojure -M:test
cd extension
uv run --with pytest --with pyright==1.1.414 pytest tests -q
From extension/babashka/, run bb test for the Babashka tests. Set
VIS_CLOJURE_BB_JVM_TESTS=1 to also test the released Clojure library. To run
the contract schema check, set VIS_CONTRACT_SCHEMA_DIR to the Vis schema
directory and add --with jsonschema to the uv run command.
Can you improve this documentation? These fine people already did:
Karol Wojcik & michal-blocketherEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |