Skip to content

--skip does not seem to work for specified subdirectories #1685

@Jackenmen

Description

@Jackenmen

Let's say you have a tree like this:

+ SomeFolder
+- pyproject.toml
+- directory
 +- subdirectory
  +- file.py

With contents of the files:

  • pyproject.toml
[tool.isort]
skip = [
    "directory/subdirectory"
]
filter_files = true
  • directory/subdirectory/file.py
import os
import collections

When using a command isort directory\subdirectory\file.py, the file directory/subdirectory/file.py gets fixed by isort.

If you change directory/subdirectory in pyproject.toml to be just directory, isort does not touch the directory/subdirectory/file.py, but I was unable to get isort to ignore directory/subdirectory.

As a workaround, you can use skip_glob with directory/subdirectory/* pattern, but it does seem like a bug to me, considering that this work fine for top-level directories.

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