Isort: Empty skip?

Created on 9 Sep 2016  路  3Comments  路  Source: PyCQA/isort

Seems that neither --skip= or skip = (in config file) work to set an empty skip list. I keep getting __init__.py was skipped as it's listed in 'skip' setting or matches a glob in 'skip_glob' setting. How to disable this default?

question

Most helpful comment

I have the same problem and -ns does not seem to do anything. It doesn't look like not_skip is used anywhere in the code.

EDIT: the -ns flag works if you run isort directly on __init__.py but not if you run it recursively (via -rc) on a folder which contains __init__.py.

All 3 comments

From isort help:

-ns NOT_SKIP, --dont-skip NOT_SKIP
                        Files that sort imports should never skip over.

So:

$ isort -ns __init__.py __init__.py
$

or in config:

[settings]
not_skip = __init__.py

For reference only __init__.py is skipped in default settings.py

@cas is correct, the reason it works this way, is if you have a default config file with a bunch of skips and you use --skip on the command line, you are most likely adding a skip, not invalidating all existing skips

I have the same problem and -ns does not seem to do anything. It doesn't look like not_skip is used anywhere in the code.

EDIT: the -ns flag works if you run isort directly on __init__.py but not if you run it recursively (via -rc) on a folder which contains __init__.py.

Was this page helpful?
0 / 5 - 0 ratings