Fork me on GitHub
Noah Bogart16:09:38

Iā€™m using to write some inline tests, and iā€™d like to have :skip-comments also apply to the tests blocks. is that possible?

Noah Bogart16:09:20

oh, nevermind me, this is accomplished by :lint-as

Noah Bogart16:09:27

i had mispelled something šŸ˜¬

Noah Bogart16:09:20

yeah! every day iā€™m pleasantly surprised by how powerful clj-kondo is

Joshua Suskalo16:09:43

Hey @borkdude do you have a recommended way to build graalvm images? The way I did it a while back was cambada, but I don't know if that's really recommended anymore.


@suskeyhose do you mean for clj-kondo?

Joshua Suskalo16:09:58

clj-kondo does it with that custom compile script I saw. I'm looking to do a graal distribution of the formatter I'm getting started working on though.


@suskeyhose I recommend doing it like this: As this will work on all platforms


including windows


nothing else is needed than bb + graalvm download


not even the clojure CLI


and this is quite the pain on Windows CI, the clojure CLI

Joshua Suskalo16:09:59

I'll definitely take a look. In an ideal world here I'd be able to make it a part of my build.clj, but we'll see if that ends up actually being achievable.


yeah I think you can also do that, but other than building the uberjar I don't think there is any other benefit to build.clj and building the uberjar already works well without build.clj

Joshua Suskalo16:09:55

Yeah, I'm just trying it out for the first time to see how it feels.


and you'll still need to install the clojure CLI on the three platforms (including Windows) to make that run


except when you use the bb clojure one of course

Joshua Suskalo16:09:26

Yeah, that's true


you can do bb clojure -Tbuild foo (or whatever the command for this is)


the built-in clojure runner is the same as the official Clojure CLI (or at least, it should be)


but using the bb task runner is faster for things that don't need a clojure process


Hi channel! Wondering if anyone can give me any tips on ignoring function args with clj-kondo? I have found the :exclude-destructured-keys-in-fn-args doc which helps for maps but I'm hoping to find this for normal fn args as well. In particular for multimethods but would be nice to know how to do it system wide too.

Joshua Suskalo17:09:27

What exactly do you mean? Do you mean disabling the :unused-binding warning on function arguments?

Joshua Suskalo17:09:52

In general there are comment forms you can use to disable particular lints for certain forms. Like this:

(defmulti some-multimethod
  (fn #_{:clj-kondo/ignore [:unused-binding]}
      [a b c]
    (keyword a b)))
This won't emit a warning for c being unused.

Joshua Suskalo17:09:42

Also @borkdude is that something we'd want to consider as a lint config in general? Like is there a reasonable way to ignore unused bindings for function arguments that are defmulti dispatch functions in particular?

Joshua Suskalo17:09:18

Since generally you wouldn't want the arglist to report that the name of an arg starts with _, since implementations probably use it.


sorry, just saw this repl. Yes! That is pretty much the issue


I'd like to not have to add inline comments all over but be able to just say for multimethods ignore unused arguments


Which maybe clj-kondo already supports, I just can't find it

Joshua Suskalo17:09:19

The other thing that I'd consider doing in some cases is to include the :arglists metadata on your functions. That one can have whatever you want in it and isn't linted.

Joshua Suskalo17:09:39

Although I don't know if that works on multimethods.

Joshua Suskalo17:09:19

It doesn't support ignoring unused arguments only in multimethods atm. I was just asking borkdude if that was something feasible to be added.


Ah, the :arglists makes sense. That's good to know about


yeah, I think we should add that option

šŸ™ 2

You can upvote it by doing a thumbs up


I proposed a solution there and marked the issue as PR welcome, if anybody wants to have a stab at it.


Oh, I didn't realize the thumbs up is an actual upvote. Do I do that on the initial description?


Done, thanks for sharing the issue


Github allows you to sort by emoticon, which is weird, but that's their only option currently


hahaha, I didn't know that. Pretty funny


it's a toy JIRA in this regard, but everybody hates JIRA ;)


I'm in the boat with everybody šŸ™‚ Agreed on GH lacking a bit though. I've been exploring actions for more custom issue and project automation. It's aight


While you're here, random question, do you know of a way in emacs with cider to accept clj-kondo suggestions? In particular removing unused imports? Or if not in emacs a way to do that in a script or something


@jon693 Oh boy, you are in for a treat, try #lsp


it builds on the clj-kondo analysis so it knows all about the linting and how to deal with the warnings, you get navigation for free, etc


The command you need in emacs with lsp-mode is lsp-organize-imports


@ericdallo can tell you more in #lsp where to start. if you install clojure-lsp then you don't need a separate clj-kondo binary installed


and you can remove the flycheck stuff


awesome! Thanks so much for this info


Hey šŸ‘‹ @jon693 Check, any issues/questions, feel free to ask in #lsp :)


Thanks @ericdallo, this looks awesome! Gonna try and dig in later and will circle back if I have questions.

metal 4