joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
dpritchett 2020-09-15T16:10:05.003900Z

Right, mine aren't likely to be super useful as tools but may be useful as simple examples of joker in action. I've never shipped any clojure/lisp etc so my toolbox is a bit limited at the moment.

2šŸ‘
dpritchett 2020-09-15T16:19:34.004300Z

Really goofy stuff to start with:

dpritchett@mage ~> joker-shell
Welcome to joker v0.15.6. Use '(exit)', EOF (Ctrl-D), or SIGINT (Ctrl-C) to exit.
user=&gt; (browser/open-search "<https://www.google.com/search?q=%s>" "joker lang")
** Looking up [joker lang] on www.google.com...
{:success true, :exit 0, :out "", :err ""}
user=&gt;

dpritchett 2020-09-15T16:20:55.004700Z

(opened https://www.google.com/search?q=joker+lang in a browser tab)

dpritchett 2020-09-15T17:34:00.005200Z

Went ahead and cleaned out internal identifiers so I could publish my jokes: https://github.com/dpritchett/jokes

3šŸ‘
dpritchett 2020-09-15T18:07:30.006600Z

Do y'all have CI workflows in place to auto-format and lint your joker code? I see --lint and --format options in joker itself but they don't seem to have edit-in-place options or "return nonzero status code when I don't like the input" options.

Candid 2020-09-23T18:23:50.000100Z

Joker's linter is supported by most major editors. It will return non-zero code if there are any warnings or errors. We use it in our CI at work.

Candid 2020-09-23T18:27:23.000300Z

Joker's formatter is only supported by Sublime Text at the moment (because this is my editor of choice so I wrote a plugin for it). Should be easy to write extensions for other major editors like emacs and vim. The formatter itself just outputs the formatted code to stdout. Sublime Text plugin (https://github.com/candid82/sublime-pretty-clojure) uses it to format currently open file on save.

1šŸ‘
dpritchett 2020-09-23T18:32:56.002300Z

Iā€™d be happy enough using the joker formatter to change my files in place. I could wire that up to an on-save trigger independent of an editor.

Candid 2020-10-04T20:58:08.001200Z

in-place mode for the formatter has been added in v0.15.7 (`--write` flag).

Candid 2020-10-04T20:59:04.001400Z

e.g. joker --format --write foo.clj