Fork me on GitHub
#clj-kondo
<
2022-03-07
>
fabrao17:03:36

Hello, I´m having this problem in clj-kondo and Calva

Can't parse /c:/Trabalho/Clientes/test/projeto/back-end/src/core.clj, Illegal char <:> at index 2: .c:.Trabalho.Clientes.test.projeto.back-end.src.core.cljclj-kondo

fabrao17:03:16

I saw this after an update

borkdude18:03:53

@fabrao Can you file an issue + repro?

fabrao18:03:56

sure, it seems to be something about Windows problem

borkdude18:03:49

@fabrao is possible, make a repro using clj-kondo on the command line

clojure -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version "2022.03.04"}}}' -M -m clj-kondo.main --lint c:/foo.clj

borkdude19:03:25

This looks like it could have to do with the new namespace linter. @UGNFXV1FA

borkdude19:03:57

@fabrao Does Calva print a clj-kondo version?

borkdude19:03:28

Can you also specify what you are using: Calva + clojure-lsp or the clj-kondo extension?

fabrao19:03:40

PS C:\> clj-kondo --version clj-kondo v2021.12.16

borkdude19:03:29

alright, thanks

borkdude19:03:45

can you try to make a repro with the updated clj-kondo on the command line too?

Stefan19:03:15

Is that also the version that Calva is using? Doesn’t it bundle its own instance of clj-kondo?

borkdude19:03:45

No, it's using the standalone clj-kondo plugin it seems, which is the newest version. clojure-lsp isn't using the newest clj-kondo yet.

Stefan19:03:09

@fabrao You could try disabling the :namespace-name-mismatch linter in your config, if that fixes it then it’s conclusive where the issue is. I’ll have a look at the source code but I didn’t think of paths including /c:/ so I’m not sure if that works.

borkdude19:03:33

Disabling that linter doesn't deactivate the code-path in which this error happens I think

fabrao19:03:54

clj-kondo --version clj-kondo v2022.03.04 -> same result

borkdude19:03:13

@fabrao can you please specify an exact repro on the command line, including the filename

Stefan19:03:28

But if it’s going wrong with clj-kondo v2021.12.16 it must be something else…?

borkdude19:03:25

This is why I'm asking for an exact command line repro. Please test with the old and new version.

fabrao19:03:25

PS C:\Windows\System32> clojure -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version \"2022.03.04\"}}}' -M -m clj-kondo.main --lint c:/Trabalho/Clientes/test/projeto/back-end/src/core.clj
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding='UTF-8'
linting took 106ms, errors: 0, warnings: 0

fabrao19:03:56

so strange !!!

borkdude19:03:14

so on the command line it behaves correctly?

fabrao19:03:49

clj-kondo --lint c:/Trabalho/Clientes/test/projeto/back-end/src/core.clj
linting took 9ms, errors: 0, warnings: 0

fabrao19:03:01

yes, no problem with command line

borkdude19:03:57

ok, please file an issue with the contents of the file and directory structure. Then I can try to reproduce using VSCode on Windows.

borkdude19:03:14

@UGNFXV1FA I guess you don't have access to a Windows machine right?

Stefan19:03:22

No. Maybe I could spin up a VM but it would take hours to get up and running. But the results above suggest it is unrelated to my PR, or am I misinterpreting?

fabrao19:03:02

Even when Calva Repl is not running, the problem happen

borkdude19:03:42

@fabrao can you downgrade the clj-kondo plugin to the previous version?

borkdude19:03:01

then we can be sure that it's not related to the new namespace linter...

borkdude19:03:15

clj-kondo does not use the Calva REPL

borkdude19:03:14

@fabrao this is how you do that:

fabrao19:03:46

Just to let you know, I tried with VSCODE + WSL 2 and no problem

borkdude19:03:47

@UGNFXV1FA I'll take a look on my Windows machine, no problem

borkdude19:03:20

yes, it's definitely Windows related and the only thing that comes to mind is that new namespace linter since that looks at the filename

fabrao19:03:01

even I installed with 2022.03.04 -> shows 2022.02.09

borkdude19:03:29

@fabrao to pin down the issue, can you please disable Calva and only use the clj-kondo extension. you have installed the clj-kondo plugin from which this error comes.

fabrao19:03:04

@U04V15CAJ you see, console is showing other version than installed

borkdude19:03:51

that console output comes from Calva, ignore it

borkdude19:03:55

and disable it

borkdude19:03:32

if you are using Calva you don't have to use the clj-kondo extension, since clojure-lsp already comes with clj-kondo included.

fabrao19:03:49

I disabled Calva, and the same problem happen

borkdude19:03:56

but now that you have bumped into this issue, let's take advantage of this and get to the bottom of it

borkdude19:03:25

yes, as I said, this is coming form the clj-kondo extension. please try the older version 2022.2.9 now

fabrao19:03:38

with older version, the problem gone

fabrao19:03:31

I re-enabled Clava, and it´s going ok

fabrao19:03:08

what a mess VSCODE did !

borkdude19:03:27

yes, so it's likely that it is introduced in the latest version. thanks for checking

borkdude19:03:46

you can uninstall the clj-kondo extension if you are using Calva

borkdude19:03:04

can you still make a Github issue for this?

fabrao19:03:16

It´s up to you

fabrao19:03:05

I have to use clj-kondo because I have clj-kondo in git action, so I have check it out before PR

borkdude19:03:47

yes, but if you are using Calva, you get clj-kondo as well, automatically

fabrao19:03:34

ok, I did´t know

borkdude19:03:36

> It´s up to you Well, please do

borkdude19:03:07

Thanks for discovering this problem before Calva/lsp updates clj-kondo though :)

fabrao19:03:21

If I didn´t use clj-kondo, I could not find the bug 🙂

fabrao19:03:44

I'll keep it to help community

borkdude20:03:14

Can you also specify the code in the file in the issue?

borkdude20:03:26

And also the full directory structure

borkdude20:03:30

so I can reproduce this locally

borkdude20:03:05

I think I've reproduced the problem:

user=> (fs/strip-ext ".c:.foo.bar")
java.nio.file.InvalidPathException: Illegal char <:> at index 2: .c:.foo.bar [at <repl>:7:1]

borkdude21:03:22

Pushing a fix to branch issue-1605-windows-test

borkdude22:03:24

fixed on master

borkdude22:03:46

will do a release tomorrow

borkdude08:03:08

Released and works in VSCode now

🎉 1
borkdude11:03:15

Ffffk, there is another problem on Windows

borkdude11:03:20

I'll disable this linter by default until these problems are solved