tools-deps

Hugh Powell 2025-03-24T21:35:45.543219Z

Not sure if this is the right place to ask this, but is it possible to determine whether a deps.edn dependency is being used or not (other than manually matching a repos :requires and :imports to their respective dependencies)? We've got a fairly large and old (comparatively) code base and it wouldn't surprise me if we've acquired dependency cruft over the years and I'd like to audit it.

borkdude 2025-03-26T11:53:04.807589Z

This does the reverse https://github.com/borkdude/deps-infer so you can then diff the deps

Hugh Powell 2025-03-26T20:37:47.141989Z

Superb, thanks @borkdude 🙇

2025-03-24T21:40:12.249079Z

remove a dependency and see if compilation fails?

2025-03-24T21:48:27.557119Z

I have some code I was playing with a while back to infer deps from clojure src code by taking the ns forms and looking for those namespaces in ~/.m2. It is sort of the inverse of what you want, but I don't know of any tools for doing what you want, and I think it could be adjusted to do it. the code for that is here https://gist.github.com/hiredman/15186e238dc365fd72e2e09c3eb7561a

Hugh Powell 2025-03-24T21:53:02.459209Z

@foo, that's the back-up plan, but we've got a lot of dependencies across our code base.

Hugh Powell 2025-03-24T21:53:45.545459Z

@hiredman interesting, I'll take a look.