How to specify multiple patterns for isort skip-glob?

1.8k Views Asked by At

How do you tell the Python isort utility to ignore multiple folder/file patterns using the --skip-glob command line option?

Skipping a single pattern works, e.g.

isort --skip-glob="**/migrations" .                  # this works

However, I'd like to do something like (similar to what I can do with black --exclude):

isort --skip-glob="**/migrations|docs|libraries" .   # this doesn't work

.
I tried the separators "," and "|".

Using --extend-skip-glob instead also doesn't work (and while the documentation here has an example of specifying multiple files in a config file, it doesn't state how to do that on the command line)

1

There are 1 best solutions below

0
On

Not sure if this is the intended way to go, but I finally used a combination of --skip-glob and multiple --extend-skip-glob parameters, like so:

isort --skip-glob="**/migrations" \
      --extend-skip-glob="docs" \
      --extend-skip-glob="libraries" \
      .