Skip to content

Enable the use of preferred-modules with submodules #7957

Open
@d33bs

Description

@d33bs

Current problem

When using the prefered-modules configuration extension there doesn't appear to be a way to specify submodules. Adding this capability would allow for greater specificity with this functionality and potentially avoid custom checker implementations.

Desired solution

For example, if we wanted to encourage the use of pathlib instead of os.path for filesystem operations without triggering warnings for os more broadly, one could use something like the following configuration line within their .pylintrc file:

preferred-modules=(os.path,pathlib)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions