Closed edvorg closed 6 years ago
Hey - this is a use case that is supported by the presence of a .lein-yagni
file that you can use to specify "entrypoints" (namespaces) that aren't directly called elsewhere in your program.
Wildcard support is something that you'd need to add yourself - I think you'd probably want to leverage merge-entrypoints
https://github.com/venantius/yagni/blob/c830d78bc439970731999ec932bd14e7eb90bf8d/src/yagni/core.clj#L18 with some sort of mapping of wildcard namespaces as matches the return value of nss-in-dirs
.
Hey - this is a use case that is supported by the presence of a .lein-yagni file that you can use to specify "entrypoints" (namespaces) that aren't directly called elsewhere in your program.
Awesome. Do I understand correctly that I can just put namespace name (not function name) into .lein-yagni and it will work?
It should, yeah
On Sun, Apr 1, 2018 at 3:00 PM Edward Knyshov notifications@github.com wrote:
Hey - this is a use case that is supported by the presence of a .lein-yagni file that you can use to specify "entrypoints" (namespaces) that aren't directly called elsewhere in your program.
Awesome. Do I understand correctly that I can just put namespace name (not function name) into .lein-yagni and it will work?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/venantius/yagni/issues/40#issuecomment-377788802, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvYW75_zNEuILFWWcTIWCZA7H6mcB-xks5tkN1igaJpZM4TC09n .
Hi, I'm using a tool called joplin that performs migration for postgresql. The way it works is it loads all clj files in directory that you have set in project.clj. Each file defines a changelog which is basically a list of changes that should be applied to to schema. Currently yagni highlights everything in that directory as dead code because it's never called directly. Is there any way to define a namespace whose files and everything that is used from these files would never appear as dead code?
Example: Joplin is set up to migrate from namespace
raven.persistence.migrations
and that namespace has two files with contents:and
Functions
up
anddown
are never called directly and are called automatically by joplin whenever I migrate or rollback db. And I'd like to find a way to whitelist things in a wildcard kind of way