Updated proposal regarding the above issue about ignoring warnings: https://github.com/borkdude/clj-kondo/issues/872#issuecomment-686315535
any chance of a new release soon, @borkdude? 🙂 keen to get that rum fix into general circulation here at Cognician
@robert-stuttaford The Rum fix is entirely done in user space
no need for a release
oh!
i'll do my homework, thanks+sorryforthenoise
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...
If anyone feels challenged to pick it up, be my guest, else I'll get to it after some other stuff
gosh how did i miss that 😊:face_palm:
Really no problem :)
omg omg it works yay
think of me when you have that next sponsored coffee thing, haha
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
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
same here on my work projects
@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?
we can't be the first ppl to do this, i'm thinking!
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.
Well, you could use clj-kondo JVM in your server and just send the lint information back to the front-end?
basically the same, but just using the JVM, not shelling out
The source code is here: https://github.com/borkdude/clj-kondo.web
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
yeah super happy to use that
found the jvm api doc nice
yeah, should also be on cljdoc: https://cljdoc.org/d/clj-kondo/clj-kondo/2020.07.29/api/clj-kondo.core
I see I forgot a {:no-doc} in an impl namespace :)
@robert-stuttaford If you want something lighter weight than clj-kondo, you might also want to look at edamame
it spits out location data also on error, in an ex-info
ahhh that might be all we need, because it's only EDN we need to lint
well kondo will give a list of all the linting issues right, which we can then send back for codemirror to display
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}
That's true, edamame will just stop parsing on error.
right
we could also build that into edamame probably, I haven't really given it much thought yet
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
edamame attaches location information where possible
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
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 :)
thanks dude!
@robert-stuttaford Note that you can lint strings using (with-in-str "(+ :foo)" (clj-kondo/run! {:lint ["-"]}))
sweet thank you, that's what we'll probably end up doing!
Little update: https://github.com/borkdude/clj-kondo/issues/872#issuecomment-686760114