Fork me on GitHub
#clj-kondo
<
2022-07-04
>
Stefan14:07:26

@borkdude I assume correct+file.clj is a valid Clojure filename, right? Because I just noticed that the namespace-name-mismatch linter behaves incorrectly on that file name. Before I look into it, I just wanted to confirm that it is indeed a valid file name.

borkdude14:07:44

Depends on the OS maybe? I would have to look into the correctness as much as you would, using google + macOS + Windows + linux

👍 1
borkdude14:07:59

Also check if clojure itself accepts this

Stefan14:07:16

Ok, I’ve put it on my list.

Alex Miller (Clojure team)15:07:49

it's a valid namespace name

Stefan15:07:43

Thanks @U064X3EF3; do you maybe also know whether it is a valid filename on all supported platforms?

Alex Miller (Clojure team)15:07:46

whether it's a valid file name is probably os-dependent

Stefan15:07:00

Oh haha that was quick thanks 🙂

borkdude15:07:13

So the issue is probably that we are calling munge on the ns name while we should call demunge on the filename.

user=> (clojure.lang.Compiler/demunge "foo+bar")
"foo+bar"
user=> (munge "foo+bar")
"foo_PLUS_bar"
(and here is me asking is demunge can be become public again :) https://ask.clojure.org/index.php/11371/consider-adding-demunge-into-clojure-core?show=11371#q11371

borkdude15:07:08

Yes, that is mentioned in the ask issue. clojure.main isn't a cross-platform namespace, so putting it there would not make demunge calls "cross platform". Adding it to core would.

Alex Miller (Clojure team)16:07:44

I added this to our 1.12 consideration list

❤️ 2
borkdude 1