clj-commons / manifold

A compatibility layer for event-driven abstractions
1.02k stars 106 forks source link

Export clj-kondo hook #238

Closed mainej closed 4 months ago

mainej commented 5 months ago

This exports the clj-kondo hook for manifold.deferred/both, along with the other clj-kondo config used internally by manifold.

Background

After upgrading my project's deps from manifold 0.2.4 to 0.4.2, I started getting unresolved-var warnings from clj-kondo everywhere I use any function that's defined after this line, which uses the both macro.

The warnings went away after merging the config from .clj-kondo/config.edn, which defines a hook that teaches clj-kondo how to interpret both, but which is available only while hacking on manifold itself, into the config in resources/clj-kondo.exports/manifold/manifold/config.edn, which is exported to projects that depend on manifold.

There's no change to hacking on manifold itself, because the internal config includes the exported config via :config-paths. This seems better than maintaining the clj-kondo config in two places.

KingMob commented 5 months ago

@mainej Thanks for this, this has sort of been on my to-do list forever. Aleph and Manifold are pretty macro-heavy (well, for Clojure), and there's some funky stuff going on, too, so clj-kondo is extra-helpful.

I'll check that it works this weekend.

KingMob commented 4 months ago

Ehh, this weekend was a bust. Life happened.

@ferdinand-beyer, does it work for you? If you want to approve it, we can merge. It's fairly low-risk.

ferdinand-beyer commented 4 months ago

Ehh, this weekend was a bust. Life happened.

@ferdinand-beyer, does it work for you? If you want to approve it, we can merge. It's fairly low-risk.

Yeah, life tends to get in the way :)

Sure, works for me. Let's merge this. Thanks!