Fork me on GitHub
#clj-kondo
<
2019-09-05
>
rickmoynihan10:09:24

I’m not sure why but flycheck-clj-kondo seems to only display warnings not errors, though they display via clj-kondo on the command line. I’m using the multiple linter setup with joker described here: https://github.com/borkdude/flycheck-clj-kondo#multiple-linters

borkdude10:09:34

what output do you see when you do flycheck-compile in a buffer?

rickmoynihan10:09:56

ahh interesting

rickmoynihan10:09:50

clj-kondo --lint - --lang clj --cache < /Users/rick/repos/project/src/proj/routes.clj
WARNING: --cache option didn't specify directory, but no .clj-kondo directory found. Continuing without cache. See .
<stdin>:90:31: warning: unused binding imd-cfg
<stdin>:107:47: warning: unused binding decile
<stdin>:120:62: warning: unused binding params
<stdin>:136:44: warning: unused binding imd-cfg
linting took 31ms, errors: 0, warnings: 4

rickmoynihan10:09:05

so it looks like it just lints a single file

rickmoynihan10:09:44

where as clj-kondo --lint src/ lints the whole project — and has visibility of the function var that has an arity error

rickmoynihan10:09:31

sorry should’ve said the specific error is an arity error

rickmoynihan10:09:43

for a function included in the project but in another namespace

borkdude10:09:44

@rickmoynihan you need to make a .clj-kondo dir in the root of your project

borkdude10:09:59

then clj-kondo will create a cache where it will remember information about your vars

rickmoynihan10:09:04

yeah was wondering if you’d say that 🙂

rickmoynihan10:09:27

ok I’d forgot you had to do this… I set it up once in another project

rickmoynihan10:09:39

thanks for the pointer

borkdude10:09:29

it also seems your clj-kondo version is not the newest?

borkdude10:09:49

since I removed that warning you see above in the latest 🙂

rickmoynihan11:09:24

I’ve mkdir .clj-kondo and when running `clj-kondo --lint “$(lein classpath)” I get the error:

rickmoynihan11:09:26

clj-kondo --version
clj-kondo v2019.08.21-alpha

borkdude11:09:36

Not sure what this is. Can you try to remove the .cache dir in .clj-kondo?

rickmoynihan11:09:49

I did that too — same error

borkdude11:09:07

did you install clj-kondo using a package manager, if so, which one?

borkdude11:09:55

should be good.

borkdude11:09:05

what's weird is that I see twice the version: .cache/2019.08.21-alpha/2019.08.21-alpha

rickmoynihan11:09:20

yeah I noticed that too

borkdude11:09:32

can't reproduce this locally:

borkdude@MBP2019 /tmp/project $ cat test.clj
(defn foo [] (inc))
borkdude@MBP2019 /tmp/project $ find .
.
./test.clj
./.clj-kondo
./.clj-kondo/.cache
./.clj-kondo/.cache/2019.08.21-alpha
./.clj-kondo/.cache/2019.08.21-alpha/2019.08.21-alpha
./.clj-kondo/.cache/2019.08.21-alpha/2019.08.21-alpha/lock
./.clj-kondo/.cache/2019.08.21-alpha/2019.08.21-alpha/clj
./.clj-kondo/.cache/2019.08.21-alpha/2019.08.21-alpha/clj/user.transit.json
although the version is used twice in the cache dir, it works as expected

borkdude11:09:55

maybe a permission thing?

rickmoynihan11:09:55

I don’t think so

borkdude11:09:13

are you on Mac or Linux?

rickmoynihan11:09:21

could flycheck clj-kondo in emacs be interfering with it in the terminal?

borkdude11:09:28

so the lock file seems to be there

borkdude11:09:46

the purpose of the lock file is to ensure only one process can write the cache

borkdude11:09:46

my lock file looks this like as well: -rw-r--r-- 1 borkdude wheel 0 Sep 5 13:07 lock

rickmoynihan11:09:42

essentially the same as mine

borkdude11:09:51

can you maybe try to reboot your computer? you never know 😛

4
borkdude11:09:22

feel free to post a repro on Github

borkdude11:09:16

you can also try to run with lein, just for the sake of testing/debugging

rickmoynihan11:09:55

ok will maybe have another look at this later

rickmoynihan11:09:12

thanks for your help — and for clj-kondo 🙂

borkdude11:09:12

the uberjar is downloadable from Github, also an option. java -jar ... --lint ...

borkdude11:09:13

if you want to disable the cache you can do --cache false

borkdude11:09:33

good luck and let me know if you have any new info

👍 4