Skip to content

Imports-blacklist should support regex #619

Closed
@SamuelCabralCruz

Description

@SamuelCabralCruz

Is your feature request related to a problem? Please describe.
It would be nice that imports-blacklist rule supports regex or match any sub-packages.

Describe the solution you'd like
adding
[rule.imports-blacklist]
arguments = ["github.com/pkgA/pkgB", "github.com/pkg1/**/pkg2"]
configuration would prevent following imports:
import "github.com/pkgA/pkgB"
import "github.com/pkgA/pkgB/pkgC"
import "github.com/pkgA/pkgB/pkgC/pkgD"
import "github.com/pkg1/pkg2"
import "github.com/pkg1/pkg0/pkg2"
import "github.com/pkg1/pkg0/pkg3/pkg2"

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions