babashka

thiru 2025-05-18T17:53:13.619549Z

Apologies if this isn't the best channel for this question. When I write babashka scripts I like to name my files with hyphens instead of underscores. I know that underscores are required for regular clojure but Babashka doesn't seem to mind (as far as I can tell). The issue is that clj-kondo reports a namespace name mismatch warning. What would you guys recommend I do to suppress or work around this warning? Of course adding this to the ignored linters is a possibility but I would like to have the warning when the the namespace mismatch is due to something other than a hyphen. Could this be raised as an issue/improvement in the clj-kondo github repo?

borkdude 2025-05-18T17:54:15.966859Z

I myself just settled for always using underscores to keep things simple

borkdude 2025-05-18T17:54:37.471869Z

you can just slap a #_:clj-kondo/ignore on the warning if you want to use a hyphen file name

👍 1
borkdude 2025-05-18T17:55:15.809379Z

you could also just avoid using ns for a script and use plain require

borkdude 2025-05-18T18:04:15.130949Z

macOS itself also seems to use this convention for tools like memory_pressure etc

😮 1
thiru 2025-05-18T18:04:32.696309Z

I was using underscores initially but it just kept irritating me when running these scripts in the cli whereas all my other scripts were using hyphens. Just being anal I suppose 🙂 But thanks I think for now I'll just opt to use the ignore directive.