Open POD666 opened 2 years ago
Thanks for raising this.
The reason it's failing is because, as per the docs, descendants of each module will also be checked.
I suppose there's an argument to say that forbidden contracts should allow source modules to import themselves and their descendants, regardless of what's listed in forbidden_modules
. But it does complicate the forbidden contract, so I'm not sure.
Let me have a think about it. In the meantime, you could implement this behaviour relatively easily as a custom contract type. Let me know if anything in the documentation is unclear.
I have tried to define following contract:
But it fails with:
I end up listing all modules from
project_web
inforbidden_modules
exceptmigrations
to avoid it.Would be nice to have a better way to do it as now I need to add every new module to the contract.
Does it sound possible?