Skip to content

New rule prohibiting modification of sys.path #15806

Open
@vraintanakarei

Description

Description

I think modification of sys.path is a bad practice because it breaks type checking, code completion, code highlighting, etc.
Therefore, I would like to ban it in my team, but I could not find a rule to check it.

If such a rule does not already exist, please consider adding a rule prohibiting changes to sys.path.
For my purpose, these codes should be prohibited with a few exceptions.

  • sys.path.append(...)
  • sys.path.extend(...)
  • sys.path = ...
  • etc.

Thank you very much.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions