You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deptrac only allows explicit dependencies listed in the ruleset and sometimes the list can get quite unwieldly, especially when there's lots of layers (e.g. a DDD project with 3 layers per bounded context and upstream relations). In these situations it would be handy if deptrac allowed transitive dependencies (IOW if B can depend on A and C can depend on B then C should be able to depend on A, too).
Since this would be a breaking change it could be implemented as a command flag (something like --allow-transitive-deps). Thoughts?
// src/Infrastructure/Controller.phpnamespaceInfrastructure;
class Controller
{
publicfunction__invoke()
{
new \Domain\Entity();
}
}
$ php vendor/bin/deptrac
deptrac is alpha, not production ready.
please help us and report feedback / bugs.
Start to create an AstMap for 3 Files.
...
AstMap created.
start emitting dependencies "InheritanceDependencyEmitter"
start emitting dependencies "BasicDependencyEmitter"
end emitting dependencies
start flatten dependencies
end flatten dependencies
collecting violations.
formatting dependencies.
Infrastructure\Controller::11 must not depend on Domain\Entity (Infrastructure on Domain)
Found 1 Violations
Desired output:
$ php vendor/bin/deptrac
deptrac is alpha, not production ready.
please help us and report feedback / bugs.
Start to create an AstMap for 3 Files.
...
AstMap created.
start emitting dependencies "InheritanceDependencyEmitter"
start emitting dependencies "BasicDependencyEmitter"
end emitting dependencies
start flatten dependencies
end flatten dependencies
collecting violations.
formatting dependencies.
Found 0 Violations
It could be useful for some architectures. I think this would, however, be better if you could specify this in the ruleset, not as a global flag. Parts of your system may have different rules.
Maybe this could be somehow specified in rules. Like "Application" means only Application and "+Application" means Application plus all layers Application can depend on.
Problem
deptrac
only allows explicit dependencies listed in the ruleset and sometimes the list can get quite unwieldly, especially when there's lots of layers (e.g. a DDD project with 3 layers per bounded context and upstream relations). In these situations it would be handy ifdeptrac
allowed transitive dependencies (IOW if B can depend on A and C can depend on B then C should be able to depend on A, too).Since this would be a breaking change it could be implemented as a command flag (something like
--allow-transitive-deps
). Thoughts?Example
Desired output:
PS related, but vague-r issue: #158
The text was updated successfully, but these errors were encountered: