Fork me on GitHub
#clj-kondo
<
2019-11-13
>
souenzzo14:11:12

(fn [& {:as opts}]) isn't the same of (fn [& opts])

borkdude14:11:49

@fiddlerwoaroof Can be implemented, but probably low priority since it's not wrong and doesn't cost you any performance if you this.

fiddlerwoaroof16:11:07

@borkdude makes sense, I thought it was an interesting case, though, because it usually comes up for me after I've eliminated all the unused bindings from destructuring.

borkdude16:11:30

low priority doesn't mean "won't implement", you're still welcome to create an issue

borkdude16:11:44

and if you want to do a PR yourself, it's more likely to get in sooner

eraserhd18:11:51

I've been puzzling over a quirk in my workflow that affects clj-kondo, among other things, and I wonder what to do about it...

eraserhd18:11:22

Basically I'm moving to always have my editor in ~/src, one level above my projects, to lower the barrier to project-switching and make some other things work.

eraserhd18:11:51

This means that a projects' .clj-kondo/config.edn isn't available by my editor's lint wrapper.

eraserhd18:11:54

I can probably patch my editor's lint script. Hmm, I think that's actually the right thing to do.

eraserhd18:11:38

well then, carry on :)

borkdude18:11:46

@eraserhd One thing I've been thinking about when linting a single file (which is what you do with editor integration) is search down from the path of the linted file instead of the cwd

borkdude18:11:35

so when you lint /tmp/foo/bar/baz.clj and your cwd is /tmp/foo but your .clj-kondo is in /tmp/foo/bar, it would still work

eraserhd18:11:35

oh neat. That would solve my problem, and since I would otherwise write a wrapper, I might as well make a PR for that.

borkdude18:11:43

yes please 🙂

borkdude18:11:21

that will also solve the problem in VSCode when you edit an "unrelated to the current workspace/dir" clojure file (not sure how common that is, cc @pez)

sogaiu19:11:49

this sounds similar to the issue i was experiencing with running clj-kondo not from the project directory as root -- clj-kondo resolves paths based on user.dir, at least i think it used to

sogaiu20:11:25

in my indexing program i resolved this by only handing absolute paths to clj-kondo's --lint

borkdude20:11:25

that's a different problem though

borkdude20:11:39

this problem has to do with resolving the location of the .clj-kondo directory

pez20:11:27

Would it still find a .clj-kondo in /tmp/foo? And what does it do if there is a .clj-kondo in both locations?

borkdude20:11:22

the cwd would basically become /tmp/foo effectively

pez20:11:58

I don’t know about others, but i certainly quite often open up a clj file from somewhere random even when working with a project.

borkdude20:11:07

yeah, but that file probably doesn't have to be saved to the cache of your project, it's just fiddling around or looking something up quickly