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

Add recursive wildcard for ignore_imports #160

Closed
ngnpope opened this issue Feb 8, 2023 · 1 comment · Fixed by #174
Closed

Add recursive wildcard for ignore_imports #160

ngnpope opened this issue Feb 8, 2023 · 1 comment · Fixed by #174

Comments

@ngnpope
Copy link
Contributor

ngnpope commented Feb 8, 2023

Support for wildcards was added in #106, but it would be nice if this could be enhanced to support a recursive wildcard.

This would allow simplifying something like this:

ignore_imports = [
    "foo.* -> bar.something",
    "foo.* -> baz.something",
    "foo.*.* -> bar.something",
    "foo.*.* -> baz.something",
    "foo.*.*.* -> bar.something",
    "foo.*.*.* -> baz.something",
    "bar.something -> baz.*.*.*.other",
]

Such that we could have the following:

ignore_imports = [
    "foo.** -> bar.something",
    "foo.** -> baz.something",
    "bar.something -> baz.**.other",
]

This would be useful when adding import-linter to existing large projects where the ignore list can be large.

@seddonym
Copy link
Owner

seddonym commented Feb 8, 2023

I agree, that would be nice. Happy to consider a pull request if anyone wants to submit one.

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

Successfully merging a pull request may close this issue.

2 participants