Skip to content

Commit

Permalink
New section - Linting
Browse files Browse the repository at this point in the history
Quick overview of linting tools I use for my Clojure projects, Joker and Eastwood.

Joker is simpler to use, thanks to the clojure-lint layer.  It does use an
external binary, which I placed on my existing executable path.  Joker uses a
sub-set of Clojure so it may give a few inaccuracies, these are usually false
positives on things like macros.  There is a way to tell joker to ignore certain
symbols though.

Still a bit of work to do on these sections, but they cover the basics.
  • Loading branch information
practicalli-johnny committed Oct 7, 2018
1 parent 3486561 commit 5106f52
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
* [Clojure Snippets](snippets/clojure-snippets.md)
* [Add your own Snippets](snippets/add-your-own-snippets.md)
* [Autocompletion](snippets/autocompletion.md)
* [Linting](linting/index.md)
* [Joker](linting/joker.md)
* [Eastwood](linting/eastwood.md)
* [Refactor code](clj-refactor/index.md)
* [Managing Library Dependencies](clj-refactor/managing-library-dependencies.md)
* [Managing Namespaces](clj-refactor/managing-namespaces.md)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions linting/eastwood.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Eastwood

> #### TODO::Work in progress
9 changes: 9 additions & 0 deletions linting/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Linting - automatically highlighting code issues

> #### TODO::Work in progress
Common linting tools includes

* [Joker](https://github.com/candid82/joker) - standalone tool, simple to use, not Clojure complete though.
* [Eastwood](https://github.com/jonase/eastwood) - leiningen plugin
* [squiggly-clojure](https://github.com/clojure-emacs/squiggly-clojure) to run Eastwood automatically from Emacs (repeatedly reloads your code in the repl, so need to ensure your code is happy with that).
22 changes: 22 additions & 0 deletions linting/joker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Joker

> ####TODO::Work in progress
To use Joker with Spacemacs you should
* Install Joker
* Ensure Joker is on the executable path in Emacs
* Add `clojure-lint` layer to `.spacemacs`



## Removing false positives

Create a .joker file in the project root and add the fully qualified name of known macros

Here's from a small rum project:

```clojure
{:known-macros [rum.core/defc
rum.core/defcc
rum.core/defcs]}
```

0 comments on commit 5106f52

Please sign in to comment.