Open sbrugman opened 9 months ago
Checking in on this. It's looking possible that my workplace will need something along these lines so I'm likely to have capacity to work on it if time is tight for you.
Something that came up in discussion, the term 'modular' is perhaps overloaded. I'm considering calling this kind of contract 'acyclic' instead. Any thoughts?
Feel free to take any of the PRs and continue. Time is tight, and it would be amazing to have these as collaborative features.
Closes https://github.com/seddonym/import-linter/issues/133
The implementation makes use of the multiple sibling modules checks of the layers contract.
For each submodule of the provided module, we squash the (copy of) the graph.
For every dependency that would be illegal by
find_illegal_dependencies_for_layers
, we check if there is a path in the reverse direction byfind_shortest_chains
. If so, then this violates the modular contract.Implementation deviates from the issue as it considers the full depth of the tree (the user can provide submodules). Does this make sense?
Uses functionality from https://github.com/seddonym/import-linter/pull/220 that we can import if merged.