Closed emdoyle closed 1 month ago
@emdoyle The basic idea is to actually reverse the working, right? Where we had --prune
as an argument to tach sync
command this would call the sync::prune_dependency_constraints
if --prune
was true. Now we can have a diff argument called --add
and whenever that is set to true we will just ignore calling the sync::prune_dependency_constraints
. Is this the right way of thinking for this issue?
@dhananjaypai08 Yes, the idea is to reverse the conditional in sync
.
When --add
is set, we should call sync_dependency_constraints
, but otherwise (by default) we should call prune_dependency_constraints
. This is essentially a reversal of the if statement in sync
.
Right now, the default behavior of
sync
is additive, meaning that it will not remove any modules or configured dependencies. Instead it will add dependencies to existing modules to fix any boundary errors detected.When using the
--prune
option,sync
ignores the currently configured dependencies, and instead sets the dependencies for each module to the minimal set matching the actual imports found in the codebase. This behavior is more consistent with the idea of "syncing" your dependencies, and should be the default behavior when callingtach sync
with no CLI arguments.The current additive behavior should be enabled by passing a renamed flag:
--add
That is,tach sync
will prune dependencies to the minimal set, whiletach sync --add
will add any missing dependencies.NOTE: This issue interacts with #145 , and may require coordination if both are worked on simultaneously