Fork me on GitHub

On the topic of writing clj-kondo hooks (ie analyze-call), the debugging instructions in suggests using prn statements. So the idea is that if I were to manually run clj-kondo from the cli - to lint some file that I know makes use of the macro I'm writing the hook for - I should see those prn statements in the command line alongside whatever linting results for the file (`eg linting took 57ms, errors: 1, warnings: 5`), right? If so, I do not see the print statements - how can I debug if I config'd it incorrectly?


I wasn't able to get it to work either, so I was just throwing errors to see the data 🙂 Subscribing to the thread.


If you don't see any output then simplify your example until you do see output and then go from there.


thanks 🙂


And previously I did evertything without terminal, used to see results only in diagnostics


terminal is easier


yes, I see now


May be docs "workflow" section would be helpful


I've written something here: But it may not be obvious that testing from the terminal is what is implied here

wow 1

How else are you going to see those printlns


I also spent like half an hour trying to debug it with repl and googling for help, then surrendered


I wasn't sure at all myself what was implied - I know for sure that there are many non standard workflows in the clojure/lisp/repl world thus I do not know what I do not know, and in this case, it is not so obvious if the answer to my question was either: 1. I made a mistake in the execution of my work/code within my hook, so I'll simplify my hook until it prints and then go from there 2. OR I made a mistake in my understanding of the workflow itself, or messed up config or namespacing or something I'm still new to, so no amount of simplifying my hook would help, as the issue was somewhere else unknown to me


@U037TPXKBGS, I just checked out the new and it is amazing. I end up adding an alias in my deps.edn:

  {:extra-deps {clj-kondo/clj-kondo {:mvn/version "LATEST"}}}
And run a repl like: clj -M:nrepl:clj-kondo


Don't know if it's a bug or I do not know somehting. One (1) way linter works with nvim-lsp-config and command line, another (2) it works only in command line. 1. I get node directly from children and then pass it to let body. 2. I get node from children, do sexp on it, then convert it back to node (result is the same in print). here is a screen for 1:


My function looks like:

(prn :key2 key2)            ;=> :key <token: bob> 
(prn :key (token-node key)) ;=> :key <token: bob>
{:node <here a let form like:
 (let [name1 value1 ... name-n value-n]
    key2 ;; key2 works, (token-node key) does't work


by 'working in command line" I mean it prints error as expected for both key2 and (token-node key) varians


If it works on the command line then it's likely that your editor doesn't use the same version of clj-kondo

😮 1

or the locations aren't being set properly in the error


yep, that's what I thought ;) > or the locations aren't being set properly in the error

💯 1