clojure-check icon indicating copy to clipboard operation
clojure-check copied to clipboard

check, analyze and inspect Clojure/Script code via the nREPL

= Clojure Check: A command-line interface to checkers via nREPL

== Rationale

This is a quicker alternative to lein eastwood or lein kibit when you already have an nREPL running. The main driver is to be able to refer this from Vim for tools like https://github.com/w0rp/ale[ALE]

== Usage

=== Downloading

There are pre-built binaries available in the https://github.com/SevereOverfl0w/clojure-check/releases[releases]. I sign all releases, so look for the Verified sign!

=== Building

I use https://github.com/Masterminds/glide[glide] to build this project.

NOTE: I had to run git config --global http.https://gopkg.in.followRedirects true with the latest git.

[source,shell]

$ glide install $ go build <1>

<1> Creates ./clojure-check

=== CLI usage

You can get output from eastwood & kibit on a running nREPL via

[source,shell]

$ ./output -nrepl localhost:33999 -namespace app.website -file - < src/app/website.clj<1> $ ./output -nrepl localhost:33999 -namespace app.website -file src/app/website.clj

<1> Read from Stdin

=== REPL setup

[source,clojure] .~/.lein/profiles.clj

{:user {:dependencies [[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]] [jonase/kibit "0.1.3" :exclusions [org.clojure/clojure]]]}}

[source,clojure] .~/.boot/profile.boot

;; OR merge this with your cider task (deftask linters "Linter profile" [] (require 'boot.repl) (swap! @(resolve 'boot.repl/default-dependencies) concat '[[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]] [jonase/kibit "0.1.3" :exclusions [org.clojure/clojure]]) identity)

== Editor integration

Inspired by http://ddg.gg/[fzf] I have included a plugin folder in this repo which allows easy integration with Vim. I welcome similar PRs for other editors.

==== Vim - ALE

There is ALE integration available in this repo. It depends on Fireplace to find connection details.


Plug 'w0rp/ale' Plug 'SevereOverfl0w/clojure-check', {'do': './install'}

==== Vim - Neomake

There is Neomake integration available in this repo. It depends on Fireplace to find connection details.


Plug 'neomake/neomake' Plug 'SevereOverfl0w/clojure-check', {'do': './install'}

let g:neomake_clojure_enabled_makers = ['check']

==== Vim - makeprg

It's easy to integrate clojure-check with :make in Vim.


Plug 'SevereOverfl0w/clojure-check', {'do': './install'}

As parameters are required for making with this CLI, I suggest you also include the ClojureMake wrapper for :make to automatically insert those args, or any similar usage of the same thing.

.ftplugin/clojure.vim

let &makeprg=g:clojure_check_bin.' $* -file %' command! ClojureMake :execute ':make '.join(ClojureCheckArgs(bufnr('%')))