Skip to content

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

Notifications You must be signed in to change notification settings

SevereOverfl0w/clojure-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ALE

Usage

Downloading

There are pre-built binaries available in the releases. I sign all releases, so look for the Verified sign!

Building

I use glide to build this project.

Note
I had to run git config --global http.https://gopkg.in.followRedirects true with the latest git.
$ glide install
$ go build (1)
  1. Creates ./clojure-check

CLI usage

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

$ ./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

~/.lein/profiles.clj
{:user
 {:dependencies
  [[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]]
   [jonase/kibit "0.1.3" :exclusions [org.clojure/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 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('%')))