This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-01
Channels
- # announcements (7)
- # babashka (72)
- # beginners (62)
- # biff (1)
- # calva (9)
- # cider (8)
- # clj-kondo (35)
- # clj-otel (8)
- # cljsrn (11)
- # clojure (98)
- # clojure-europe (25)
- # clojure-germany (1)
- # clojure-norway (9)
- # clojure-uk (2)
- # clojured (3)
- # clojurescript (12)
- # conjure (3)
- # core-logic (4)
- # cursive (18)
- # datalevin (9)
- # datomic (5)
- # defnpodcast (2)
- # exercism (1)
- # graalvm (5)
- # gratitude (6)
- # hyperfiddle (3)
- # interop (12)
- # jobs (1)
- # joyride (34)
- # lsp (22)
- # meander (14)
- # missionary (16)
- # nbb (88)
- # off-topic (4)
- # pathom (20)
- # podcasts-discuss (1)
- # polylith (13)
- # portal (10)
- # re-frame (6)
- # releases (2)
- # remote-jobs (2)
- # rewrite-clj (3)
- # shadow-cljs (3)
- # spacemacs (6)
- # vim (24)
I'm working on clj-kondo hooks workshop material now for next week's ClojureD. Is there anyone who isn't going there and wants me to help go through the material? Please give me a ping :)
Is there a way to set up linting for plumbing.core/fn->
? if I lint as clojure.core/->
I still get type and arity errors for the first form. I’d rather not exclude if I can get away with it
Try the :macroexpand
hook:
https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#macroexpand
and see if that works for you
I'm working on a more gentle introduction to hooks here: https://github.com/clj-kondo/hooks-workshop-clojured-2022 This is work in progress and will be used for a workshop next week on ClojureD
TIL that the version of clojure-lsp I installed from homebrew is super old. After fixing that and following the example it seems to be working. I essentially just copied the source from plumbing.core but I gather that I don’t actually need to do that if the real macro is happy being run from SCI?
hmm maybe I spoke too soon. It’s not complaining anymore but emacs is now highlighting the entire (fn-> ….)
form like it’s a symbol when my cursor is in it and it’s showing a gensymed symbol in the minibuffer. No idea where in the kondo->lsp->emacs chain that issue is coming from
And then:
(def f (fn-> inc inc))
(f 1 2)
gives a lint warning about calling f with an incorrect amount of args (which is expected)to be clear it does lint correctly now. if I do (fn-> str inc)
it complains that it’s getting a string when it expects a number
What I’m seeing is that now clojure-lsp seems to think the entire fn->
form is a symbol so it highlights it and puts the symbol at the bottom, just like if I had put my cursor on def
Yeah, this is an artifact of :macroexpand
. If you want more precise linting, use :analyze-call
I think I get the picture of what is needed from the docs but you might have the workshop part written by the time I get to poking at this tomorrow.
is there a good way to distribute this sort of config? plumbing is a pretty popular library. Or is the idea that they become part of the library itself?
You can make a PR to put it in the config exports in the library's resources.
I think there's a community project to distribute them too if the library owner refuses to accept a PR to make it part of their library exports.
Yes: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration Here are some examples :) https://github.com/clj-kondo/clj-kondo/discussions/1528
I think we have a fair chance of getting this into plumbing, since @U055XFK8V is a maintainer there
The community project is https://github.com/clj-kondo/config
But it's currently not fine-grained, it imports all of those which isn't really optimal
cool, if I get analyze-call working and I get a free moment I’ll PR up at least the stuff that I use on a regular basis. Hopefully that will provide a kernel to grow from.
Hi guys! Is there a way to detect that (inc pokemon)
is incorrect (like (inc "1")
) because pokemon
has a Pokemon schema?