This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-09
Channels
- # adventofcode (132)
- # announcements (19)
- # babashka (7)
- # babashka-sci-dev (6)
- # beginners (46)
- # calva (25)
- # chlorine-clover (5)
- # cider (2)
- # clara (17)
- # clj-kondo (93)
- # clojure (2)
- # clojure-dev (4)
- # clojure-europe (12)
- # clojure-losangeles (3)
- # clojure-nl (7)
- # clojure-uk (4)
- # clojurescript (29)
- # conjure (6)
- # core-async (8)
- # cursive (16)
- # data-science (7)
- # datomic (1)
- # exercism (4)
- # figwheel-main (8)
- # fulcro (9)
- # graphql (2)
- # helix (1)
- # introduce-yourself (3)
- # jobs (3)
- # lsp (4)
- # malli (20)
- # minecraft (3)
- # nextjournal (62)
- # off-topic (16)
- # overtone (34)
- # pathom (5)
- # polylith (10)
- # portal (1)
- # re-frame (104)
- # reagent (29)
- # reitit (1)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (22)
- # spacemacs (2)
- # sql (10)
- # tools-deps (17)
- # vim (13)
I just filed a PR but one of the tests on CI fails and I’m not sure if it’s my code or something unrelated. https://app.circleci.com/pipelines/github/clj-kondo/clj-kondo/4076/workflows/1aca8e2a-61cc-4e40-951e-5b8380f42b9d/jobs/16417
Tests run all find locally when doing script/test
Ok, if it looks related I’ll take another look. Now off to do work that pays the bills 🙂
👋 What's the debugging strategy when running linters through LSP jar? I have a linter that works via CLI but warnings are not appearing in Cursive. I guess clj-kondo should be storing logs somewhere?
@borkdude Hey, no clojure-lsp, but kondo's LSP JAR
Thanks for creating the library btw 🙏 I'm working on linters for React hooks at Pitch. No promises, but will try to publish the linter when it's done and tested.
> ok, I see. are you using the same version on the command line and LSP jar? uh, good question, let me check
alright, now I'm running both LSP and CLI of the same version, CLI works, LSP doesn't 😞 is there a way to get into logs?
I'm not sure if it logs anything interesting, but the source is here: https://github.com/clj-kondo/clj-kondo.lsp You can build the uberjar yourself and stick some logging in there
If you run bb tasks
with babashka, you can see all tasks that are possible in this project
thanks 🙏
btw, I'd love to have all predicates for all clj-rewrite token types (`vector-node?` etc) to be exposed in SCI env when running hooks. Doesn't seem like there's a way to extend SCI config, would you accept a PR for that? (to include more predicates)
open an issue, then followed by a PR. See https://github.com/clj-kondo/clj-kondo/blob/master/doc/dev.md#workflow for workflow
This is my ducky workaround for now 😄 (= (str (type f)) "class clj_kondo.impl.rewrite_clj.node.fn.FnNode")
quick feedback: :__dangerously-allow-string-hooks__
option is great when developing linters in REPL
I've also tried writing hooks in a separate file first, but seems like kondo is not picking up changes, perhaps caching?
oh right, yes, it re-uses the SCI context and if you already loaded the hooks, it won't reload them again.
ok, I got it working, but... 😄
• api/reg-finding!
seem to be ignoring :end-col
and :end-row
?
• warning/error messages are not showing up in a popover when hovering over underlined code (this is working fine with clojure-lsp, but not with clj-kondo lsp 😞)
🎉 how are you calling reg-finding? can you verify if the end-col and end-row are there to begin with?
about the popover - I'm not sure what clj-kondo.lsp and clojure-lsp are doing differently - is this something you would know about @UKFSJSM38?
not really, I can't see anything clojure-lsp is doing diferently about that :thinking_face:
> perhaps it has to do with end-row / end-col then what interesting is that the message is not showing up for default linters as well
this one seem to include end row/col
wait...
nah it doesn't, I've double checked
no message in a popover in both kondo lsp and clojure-lsp
god dammit
Come to emacs 😛 Just kidding, unfortunately the intellij lsp plugin is not actively mainted as much as other lsp editors plugins :/
hehe, I guess I'll stop writing those linters then
@U0FR82FU1 you're still writing it for those who use clj-kondo on the command line or in other editors ;)
Although, clj-kondo is used a lot, for example on clojure-lsp that is used on editors like VScode/emacs/vim
Clojure community really needs more hands to provide a good dev experience
lots of Pitchers are using Cursive, but yeah, could be useful for others and CI as well
I've also asked @U0567Q30W if he was interested in adding clj-kondo to Cursive, and he was open to that. You can bring this to his attention again.
And ask in #cursive how other Cursive users are using clj-kondo, there are a few of them
at least at nubank, the people who use cursive doesn't just run the lint on the command line and fix it manually :(
and for complex macros (that we have clj-kondo config) they just live with that not working on cursive 🥲
that's why Nubank is now recommending to new devs using editors with LSP support :)
gluing everything together is hard
perhaps forking the lsp plugin could work - but I can imagine that appears to be a daunting task
or making a bespoke intellij plugin for clj-kondo - but I really hope that @U0567Q30W will just add clj-kondo support to Cursive
@U0FR82FU1 another thing btw. does CIDER work with intellij - i.e. do CIDER warnings get propagated to intellij as diagnostics?
No idea :woman-shrugging:
the problem is, I could make an intellij plugin, but I never use it, so it wouldn't be as maintained as when I would use it
no, I only use what Cursive provides out of the box, now trying with clj-kondo, but no luck so far
@U0FR82FU1 btw, you can also get clj-kondo running as a github action and it will print diagnostics in the code as feedback
we do use it to lint PRs, working great 👌
I think @U5B8QSSC9 configured clojure-lsp on intellij, maybe ask if he got the same issue with the popup
@U0522TWDA I think also uses clj-kondo + Cursive...
trying with file watcher, seems like it works for others
I had some problem with using clj-kondo directly via a file watcher, which I don't remember. And I have given up on Clojure-lsp because the IntelliJ LSP plugin somehow sends many unfounded "file changed" messages in a short time (on my largish project) , which kills my cpu. So I started using kondo via a pre-commit hook.
@U0522TWDA clojure-lsp is ATM ignoring those messages so maybe give it another try makes sense?
Ah, awesome, thanks! Will try!
doesn't work via file watchers at all, lol
prints something about FILE_PATH is undefined
, but ignoring that var doesn't make any difference
although I do see linting output in IDE's console
@U0FR82FU1 here are some instructions: https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#file-watchers--installed-binary
that's what I've followed
@U06S1EJPL has edited that section a few times - perhaps he knows stuff?
@U0FR82FU1 I've talked to @UQTHDKJ8J who is the author of a IntelliJ plugin called "Clj Stuff" and it will soon support clj-kondo