Fork me on GitHub
#clj-kondo
<
2020-02-26
>
tzzh11:02:34

Hey, I am a huge fan of kondo and have set it up in all my clojure projects 🙂 I was wondering if there plans to add fixers to automatically fix some of the linting errors ? I’ve just set it up on an existing project and the output is errors: 151, warnings: 421 😿 so it’d be really cool if it can do some of the work for me

borkdude11:02:22

Thanks! Carve is an example of a project that uses clj-kondo AND fixes stuff automatically in your code. I suggest you take a look at that. Clj-kondo will be linting only.

tzzh11:02:37

OK amazing I’ll take a look, thank you :thumbsup:

avi15:02:38

I’ve been meaning to try Carve since you first announced it but honestly I forgot… this chat reminded me that it exists. I just tried it out on my project and wow that’s great. Thank you!

borkdude15:02:54

thanks 🙂

sparkofreason22:02:05

Given this in config.edn: :lint-as {com.rpl.proxy-plus/proxy+ clojure.core/defrecord}, using proxy+ does not show interface/class symbols as used. So for example:

(proxy+ []
  Combine$CombineFn
  (createAccumulator
   [_]
  ...)
will still give a warning that Combine$CombineFn is unused. Not a big deal nor very surprising, since it would seem to hard to cover this in general, just thought I'd mention it in case there was some other way I should configure or something.

borkdude22:02:21

probably linting as clojure.core/proxy makes more sense?

borkdude22:02:56

I don't see how the syntax of proxy+ lines up with defrecord exactly

sparkofreason13:02:32

You're right, proxy+ doesn't have a name, probably shouldn't have expected it to work in the first place. proxy+ also doesn't have the same syntax as proxy, though I'll give it a try anyway.

borkdude13:02:52

You can just exclude unresolved symbols in this macro

sparkofreason14:02:02

Using reify instead of defrecord did the trick. Nice!

borkdude22:02:00

currently clj-kondo mostly ignores what's going on inside proxy, but that will likely improve in the future