seddonym / import-linter

Import Linter allows you to define and enforce rules for the internal and external imports within your Python project.
https://import-linter.readthedocs.io/
BSD 2-Clause "Simplified" License
679 stars 49 forks source link

Add exhaustiveness to layers #94

Closed leamingrad closed 1 year ago

leamingrad commented 3 years ago

This PR adds the concept of "exhaustiveness" to layers contracts. An exhaustive contract is one where the contract definition is guaranteed to specify all layers that may exist in the containing modules. Users can also ignore submodules from the exhaustiveness checks if that flexibility is needed.

The aim of exhaustive contracts is to make it impossible to add a new layer into a container without considering where it fits in the hierachy.

The PR contains various bits of housekeeping that I did while trying to get a clean tox run on my local machine - I can drop them if preferred.

leamingrad commented 3 years ago

@skarzi Thanks for the prompt comments. I would like to get the immutable default arguments one agreed before making changes to the code.

seddonym commented 1 year ago

Superceded by https://github.com/seddonym/import-linter/pull/144