hugsql

shem 2023-03-18T10:10:16.055569Z

https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#unrecognized-macros I noticed this new clj-kondo feature. I wonder if there's plans to add this metadata to hugsql macros? in one of our sql-heavy projects it would cut down linter noise considerably

borkdude 2023-03-18T10:11:42.241979Z

@shem can you give an example of such a macro?

shem 2023-03-18T10:22:42.901939Z

Err...I was thinking of def-db-fns, which in the version of hugsql we are using is a macro but it seems in the current version is a function...

shem 2023-03-18T10:26:59.243729Z

maybe just upgrading hugsql helps for "unresolved symbol" linter errors for the functions introduced by def-db-fns?

borkdude 2023-03-18T10:30:06.597359Z

There is a popular stackoverflow question about this: https://stackoverflow.com/questions/61727582/how-to-avoid-unresolved-symbol-with-clj-kond-when-using-hugsql-def-db-fns-macro

borkdude 2023-03-18T10:33:46.929729Z

So: 0) use declare to "help" clj-kondo 1) or isolate your hugsql generated vars in a separate namespace 2) use {:linters {:unresolved-var {:exclude [your-hug-sql-functions-ns]}}} if necessary

0️⃣ 1
shem 2023-03-18T10:34:13.887409Z

that's right, I wasn't thinking straight about this. it's not def-db-fns that is the problem but the functions it introduces.

borkdude 2023-03-18T10:35:02.601919Z

hope it helps

shem 2023-03-18T10:37:03.398609Z

we'll find a way. thanks