I'm slowly building my Clojure setup on Sublime Text based on clj-kondo and it's been a super fun experience! But since I'm doing everything based on the analysis output, I don't have a REPL to do anything, and now I'm wondering how to get the location of a file which is in my classpath e.g.: clojure/core.clj
. In a Clojure REPL we could (<http://clojure.java.io/resource|clojure.java.io/resource> "clojure/core.clj")
, but...I don't have a REPL. How would you do it?
I need to know the path of the file so I can implement a Go to... type of thing.
The analysis includes the locations of files, right?
This 'filename': 'clojure/core.clj',
Not the full path.
Am I missing something?
@pedrorgirardi Ah, this is a bit hidden, here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#output-canonical-file-paths
Ohh,,this is great!
Thanks @borkdude!
Welcome. Keep us posted about your cool project :)
It's amazing what you can do based on clj-kondo's analysis output. It's really good! 🙂 I started working on this for myself, I would like to use Sublime Text to program in Clojure, but maybe it could be something others could use too. It's very early days still, so we will see.
Another question. I do the initial setup to create a clj-kondo cache and all. But then, I have a Sublime Text command to analyze the classpath which I use to "index" var definitions & usages. I'm currently running with these options whenever I want to analyze the classpath:
(It's Python)
Is this the way to go?
yes, that looks good. if you analyze everything, you don't have to do anything else before it, except to create a .clj-kondo
directory.
Right, I got you.
is there a way to disable redefined-var
warnings inside comment
blocks?
in general or one specific comment block?
in general
or similarly, unresolved
in (comment)
?
you can turn off all linting in comment forms with {:skip-comments true}
Perhaps we should disable the redefined-var
linter in the comment form by default as I can't come up with a reason why this would be unreasonable to do.
@adam678 Your issue can be solved with:
$ clj-kondo --config '{:linters {:unresolved-symbol {:exclude [(clojure.core/comment)]}}}' --lint - <<< '(comment a b)'
linting took 11ms, errors: 0, warnings: 0
@martinklepsch Feel free to post an issue about this.
@borkdude wouldn’t the approach above work for redefined var too?
yeah, we could implement that as well
but it's a bit weird to do this for vars, since they are usually defined top level and not inside some other call
so comment is a bit of a special case
let's just make an issue for it and then think about the right config later
I would be fine with just disabling the redefined var linter inside comment blocks
Hey, everyone 🙂 Sorry if I've missed it, but is there a way to blanket ignore a namespace?
@mbutler you can do it like this: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#include-and-exclude-files-from-the-output
Awesome, thanks man :)