Skip to content

Isort does not honor skip directories #2273

@alex-morgun

Description

@alex-morgun

Problem:
I have a python project, trying to skip directories, somehow it gos to .cache and ignores all my efforts to skip it.

I guess my .venv may have a link to .cache, but why don't isort check directory path?

isort . --skip=".cache" --interactive

--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  20

isort . --skip-glob="**/.cache/*" --interactive
--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  2024-06-30 02:59:45.979922

isort --settings-path ./pyproject.toml --interactive .

--- /home/user/.cache/serverless-python-requirements/649a0cce5c24ce3a831267ed1824fdb9b81342d2fe79bfbb8e22ff4b581f0dcc_x86_64_slspyc/openai/cli/_api/models.py:before  2024-06-30 02:59:45.979922
[tool.isort]
profile = "black"
skip = [".venv", "node_modules"]
skip_glob = ["*/.cache/*", "*/.venv/*", "*/node_modules/*"]

Solution:

isort package_path/

Metadata

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