clj-kondo

2025-08-19T10:10:33.175179Z

Is there a macro that follows the (deffoo ::some-keyword args & form … pattern that can be used as a lint-as option? Trying to think of an example of that in regular clojure.

2025-08-19T10:10:58.659339Z

It’s basically a defn with a keyword instead of a symbol

borkdude 2025-08-19T10:12:38.262699Z

This has come up a couple of times but I don't think there is any macro in core that uses a keyword to define a var. I also don't understand why you would do this btw

2025-08-19T10:23:06.803099Z

It’s a macro in an existing project.

borkdude 2025-08-19T10:23:20.604689Z

which one?

2025-08-19T10:23:53.413219Z

A closed source one

2025-08-19T10:24:05.622639Z

For work.

borkdude 2025-08-19T10:25:03.638049Z

ok. no solution here. write a hook :macroexpand will be the easiest, :analyze-call will be the most accurate

🙏 1
2025-08-19T10:34:26.403729Z

Ahh, hooks can’t be inline. I guess I’ll see if the macro can be changed/refactored to use a symbol instead of a keyword. Might be less work. Is the main reason clj-kondo can’t macro expand itself security?

2025-08-19T10:34:48.650539Z

I remember I think it was fennel can macroexpand with the linter as lua can sandbox

borkdude 2025-08-19T10:35:00.486449Z

the main reason is that most macros need context and aren't pure functions

👍 1
borkdude 2025-08-19T10:36:30.367229Z

like, they need context about other vars in other namespaces, aliases, etc

2025-08-19T10:36:53.747329Z

Ah yeah that makes sense.