Fork me on GitHub
#clojure-nl
<
2019-04-05
>
gklijs08:04:04

Morning, working out the multi tenancy plans for my current project, hoping to make a valid case to go to a streaming platform. And a bug of course.

Stefan08:04:43

Cool @borkdude, I just brewed it. Question: on one of my three source files, it gives an error:

$ clj-kondo --lang cljs --lint ./src/main/myapp.cljs
./src/main/myapp.cljs:0:0: error: Can't read ./src/main/myapp.cljs, no conversion to symbol
Any idea what’s wrong? (source here: https://github.com/svdo/CLJSReactNativeNavigation/blob/4277eea5d5ce365cfad39be46c9feda821c7bd79/src/main/myapp.cljs)

borkdude08:04:05

@stefan.van.den.oord Thanks, I’ll look into it

borkdude09:04:56

@stefan.van.den.oord It chokes on the string namespaces. I’ll fix it and let you know

Stefan09:04:57

Great thanks!

borkdude09:04:30

@stefan.van.den.oord Are you on linux or Mac?

Stefan09:04:06

Sure, hang on…

Stefan09:04:03

Ok it doesn’t give any output anymore, I guess that means it works 🙂

borkdude09:04:17

you can try to make a deliberate error in your project to see if it detects it

Stefan09:04:26

I just did and it works as intended. Thanks for teaching me about the inline-def debugging technique by the way! 🎉

borkdude09:04:18

Thanks for trying out clj-kondo and reporting the bug!

👍 4
thomas10:04:12

I just ran it as well on my latest project and no errors!!! yeah

borkdude10:04:20

Can you make a deliberate error to see if it works at all?

thomas10:04:27

let me try...

thomas10:04:00

./src/xxx_import/core.clj:106:4: warning: inline def

borkdude10:04:05

cool. did you scan the entire classpath? that way you’ll also detect invalid arities to library calls from your own source

thomas10:04:21

that is the only file I have at the moment

borkdude10:04:50

no libraries in your project?

borkdude10:04:56

I mean like this: clj-kondo --lint $(lein classpath) | grep your-ns

thomas10:04:03

let me try that

gklijs11:04:06

It's so fast I can even run it on my entire workspace folder some nice/weird things like

../advent-of-cljc/src/aoc/y2018/d07/mfikes.cljc:45:9: warning: obsolete let
../advent-of-cljc/src/aoc/y2018/d08/borkdude.cljc:11:3: warning: obsolete do
../open-bank/target/cljsbuild-compiler-1/cljs_http/client.cljs:369:16: error: Wrong number of args (1) passed to cljs.core/get
../open-bank/target/cljsbuild-compiler-1/reagent/ratom.cljs:91:3: error: Call to private function pr-writer
../pokequiz/resources/public/js/compiled/out/cljs_http/client.cljs:359:35: error: Wrong number of args (1) passed to cljs.core/get
../pokequiz/resources/public/js/compiled/out/re_frisk/core.cljs:103:21: error: Wrong number of args (0) passed to re-frisk.core/unmount-view

borkdude11:04:32

that error about cljs_http seems correct, since the author didn’t require get here: https://github.com/r0man/cljs-http/blob/master/src/cljs_http/client.cljs#L354

borkdude11:04:49

clj-kondo lints comment sections by design, since I want to keep examples up to date.

borkdude11:04:18

but you can turn it off by providing the flag --ignore-comments. That’s not yet documented since I’m not sure what the best way is to accomodate future options yet. So it might change…

borkdude11:04:58

The reagent error is a false positive, since the linter thinks it’s calling https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L10176

borkdude11:04:56

I’ll make an issue for that

borkdude11:04:02

or maybe it is correct, I don’t know actually

borkdude11:04:18

I think it’s a bug in CLJS itself that it doesn’t warn about private usage from cljs.core. E.g.:

$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}}' -m cljs.main -re node
Downloading: org/clojure/clojurescript/maven-metadata.xml from 
ClojureScript 1.10.520
cljs.user=> (maybe-warn 1)
1
nil
The function maybe-warn is private in cljs.core.

thomas12:04:14

david nolen might know the answer