Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: minimum imports #218

Open
sbrugman opened this issue Feb 23, 2024 · 1 comment
Open

Feature request: minimum imports #218

sbrugman opened this issue Feb 23, 2024 · 1 comment

Comments

@sbrugman
Copy link
Contributor

sbrugman commented Feb 23, 2024

Prematurely generalization by moving functions to different modules (e.g. common, utils) can lead to a convoluted codebases. This can lead to global chaos, especially in mono-repos.

It would be interesting to be able to require a minimum number of imports between certain modules, for instance, utility functions at the top level of the module need to be imported by at least two submodules.
(Two+ links in the import graph)

(If you think in terms of number of links, then forbidden is just the special case where max=0)

@seddonym
Copy link
Owner

Interesting idea! So are you thinking this would be a new contract type?

One option for this would be to implement it as a custom contract to begin with. It could even be published as its own PyPI package and have a different maintainer, if someone is interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants