Fork me on GitHub
#clj-kondo
<
2020-09-03
>
borkdude07:09:46

Updated proposal regarding the above issue about ignoring warnings: https://github.com/borkdude/clj-kondo/issues/872#issuecomment-686315535

robert-stuttaford12:09:07

any chance of a new release soon, @borkdude? 🙂 keen to get that rum fix into general circulation here at Cognician

borkdude12:09:38

@robert-stuttaford The Rum fix is entirely done in user space

borkdude12:09:44

no need for a release

robert-stuttaford12:09:57

i'll do my homework, thanks+sorryforthenoise

borkdude12:09:37

No problem! I'm glad it can be done in user space, since I got another report about it: https://github.com/borkdude/clj-kondo/issues/987 Multi-arity components...

💯 3
borkdude12:09:04

If anyone feels challenged to pick it up, be my guest, else I'll get to it after some other stuff

robert-stuttaford12:09:26

gosh how did i miss that 😊:face_palm:

borkdude12:09:03

Really no problem :)

robert-stuttaford12:09:33

omg omg it works yay

robert-stuttaford12:09:58

think of me when you have that next sponsored coffee thing, haha

borkdude12:09:00

I will tomorrow, thanks for sponsoring ;) Hopefully there will be a release somewhere in the middle of this month, featuring this new thing: https://github.com/borkdude/clj-kondo/issues/872#issuecomment-686315535 If you have any ideas about it, there's still time

robert-stuttaford13:09:22

very interesting! i don't have anything of value to add. we live with our linting errors, but clean them up as we work through old places

borkdude13:09:43

same here on my work projects

robert-stuttaford14:09:51

@borkdude do you perhaps have any guidance / writing on integrating kondo into a clojure app (e.g. a web app) to lint EDN editors inside CMSes? so basically https://clj-kondo.michielborkent.nl/ but with the server side using kondo-in-jvm-clojure instead of shelling out to the bb version?

robert-stuttaford14:09:31

we can't be the first ppl to do this, i'm thinking!

borkdude14:09:34

that front-end is shelling out to the clj-kondo binary, it has nothing to do with bb, but I get the point: shelling out.

borkdude14:09:22

Well, you could use clj-kondo JVM in your server and just send the lint information back to the front-end?

borkdude14:09:34

basically the same, but just using the JVM, not shelling out

borkdude14:09:31

I used CodeMirror, but there are also alternatives to this. I was just familiar with that one, it has a linting plugin to display warnings

robert-stuttaford14:09:50

yeah super happy to use that

robert-stuttaford14:09:26

found the jvm api doc nice

borkdude14:09:50

I see I forgot a {:no-doc} in an impl namespace :)

borkdude14:09:30

@robert-stuttaford If you want something lighter weight than clj-kondo, you might also want to look at edamame

borkdude14:09:13

it spits out location data also on error, in an ex-info

robert-stuttaford14:09:37

ahhh that might be all we need, because it's only EDN we need to lint

robert-stuttaford14:09:24

well kondo will give a list of all the linting issues right, which we can then send back for codemirror to display

borkdude14:09:05

@robert-stuttaford

user=> (require '[edamame.core :as e])
nil
user=> (e/parse-string "{")
Execution error (ExceptionInfo) at edamame.impl.parser/throw-reader (parser.cljc:89).
EOF while reading, expected } to match { at [1,1]
user=> (ex-data *e)
{:type :edamame/error, :row 1, :col 2}

borkdude14:09:30

That's true, edamame will just stop parsing on error.

borkdude14:09:51

we could also build that into edamame probably, I haven't really given it much thought yet

borkdude14:09:43

you could also use both, since you can also verify a valid EDN structure according your own rules and give extra lint warnings if it doesn't conform to your specs for example

borkdude14:09:55

edamame attaches location information where possible

borkdude14:09:28

there's also a mode to return different kinds of nodes instead of numbers and strings, so you can still have location info for those as well

borkdude14:09:49

There's also a docker image for clj-kondo: you might get away with using that instead of the binary on the server as well. Anyway, plenty of ideas :)

borkdude15:09:16

@robert-stuttaford Note that you can lint strings using (with-in-str "(+ :foo)" (clj-kondo/run! {:lint ["-"]}))

robert-stuttaford16:09:05

sweet thank you, that's what we'll probably end up doing!