Fork me on GitHub
#joker
<
2020-09-15
>
dpritchett16:09:05

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.

šŸ‘ 6
dpritchett16:09:34

Really goofy stuff to start with:

[email protected] ~> joker-shell
Welcome to joker v0.15.6. Use '(exit)', EOF (Ctrl-D), or SIGINT (Ctrl-C) to exit.
user=> (browser/open-search "" "joker lang")
** Looking up [joker lang] on www.google.com...
{:success true, :exit 0, :out "", :err ""}
user=>

dpritchett17:09:00

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

šŸ‘ 9
dpritchett18:09:30

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.

Candid18:09:50

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.

Candid18:09:23

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.

šŸ‘ 3
dpritchett18:09:56

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.

Candid20:10:08

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

Candid20:10:04

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