babashka

grzm 2025-11-03T19:50:48.620019Z

Hello! It looks like perhaps the clj-kondo config for the babashka.fs/with-temp-dir doesn't match the macro signature. https://github.com/babashka/fs/blob/master/resources/clj-kondo.exports/babashka/fs/config.edn

{:lint-as {babashka.fs/with-temp-dir clojure.core/let}}
๐Ÿงต

lvh 2025-11-04T20:19:56.987309Z

excited to see you there (both of you) -- and yes, I forgot to file a ticket but ran into the same issue recently

grzm 2025-11-04T20:21:19.319659Z

๐Ÿ‘‹ @lvh

borkdude 2025-11-04T20:21:38.997789Z

excited!!

borkdude 2025-11-03T19:53:13.373819Z

Did you mean to post the below message in this thread?

grzm 2025-11-03T19:53:59.882739Z

I did. And I will. sadpanda

borkdude 2025-11-03T19:54:09.834609Z

no worries!

grzm 2025-11-03T19:54:22.791859Z

% cat src/com/grzm/x/fs_ex.clj                    
(ns com.grzm.x.fs-ex
  (:require [babashka.fs :as fs]))

(defn show-me-the-temp-dir [_]
  (fs/with-temp-dir [dir]
    (println (str dir))))

% clojure -X com.grzm.x.fs-ex/show-me-the-temp-dir
/var/folders/7t/5n6k1ww51qng56y9r_2hszpr0000gn/T/0857b224-d823-4097-859e-dbb285710c238828738234203815657

 % clj-kondo --lint src               
src/com/grzm/x/fs_ex.clj:5:21: error: with-temp-dir binding vector requires even number of forms
linting took 81ms, errors: 1, warnings: 0
https://github.com/babashka/fs/blob/master/src/babashka/fs.cljc#L1180-L1206
(defmacro with-temp-dir
  "docstring elided"
  {:arglists '[[[binding-name] & body]
               [[binding-name options] & body]]}
  [[binding-name options & more] & body]
  {:pre [(empty? more) (symbol? binding-name)]}
  `(let [~binding-name (create-temp-dir ~options)]
     (try
       ~@body
       (finally
         (delete-tree ~binding-name {:force true})))))

borkdude 2025-11-03T19:54:28.768509Z

I agree, we could make a better hook for this

borkdude 2025-11-03T19:54:57.961429Z

if you want to make clj-kondo happy, you can insert an empty map as the second arg

๐Ÿ‘ 1
borkdude 2025-11-03T19:55:09.231289Z

issue welcome!

borkdude 2025-11-03T19:55:18.945209Z

btw, will you perhaps be at the conj this year?

grzm 2025-11-03T19:56:01.697959Z

> if you want to make clj-kondo happy, you can insert an empty map as the second arg Good idea. I've currently added #_:clj-kondo/ignore.

grzm 2025-11-03T19:56:22.851939Z

And yup, I'll be there. Are you headed across the Big Water?

borkdude 2025-11-03T19:56:34.637199Z

you will? great! yes, I'll even be doing a talk :)

grzm 2025-11-03T19:57:00.823119Z

Oh, boy! Looking forward to it!

borkdude 2025-11-03T19:57:05.589589Z

me too!

grzm 2025-11-03T20:03:22.274869Z

Here you go https://github.com/babashka/fs/issues/155

borkdude 2025-11-03T20:03:54.596429Z

thanks!

grzm 2025-11-03T20:04:02.669719Z

Not currently savvy enough to know how to provide the proper hook.

borkdude 2025-11-03T20:07:00.988079Z

no worries, I'll figure one out.

borkdude 2025-11-03T20:07:34.832359Z

if you have time and want to give it a try, you may want to copy a hook from that thread pool library that I forgot the name of

borkdude 2025-11-03T20:09:13.155279Z

oh yes claypool

borkdude 2025-11-03T20:10:01.819179Z

but don't worry, I'll figure it out eventually