Isort: Settings path CLI option

Created on 1 Jun 2018  路  3Comments  路  Source: PyCQA/isort

Hi @timothycrosley, I see that isort has a -sp, --settings-path option. Am I right if I say that it allows users to specify the configuration file path for isort? If yes, then it does not seem to work :confused:. I see that #170 was closed without saying the CLI option was implemented. Was it?

I use it like this: isort --settings-path config/isort.conf --check-only --recursive src, but then the output does not match what I configured in this settings file (files that should be skipped aren't, etc.)

documentation enhancement

Most helpful comment

This isn't remotely clear in the option's documentation. @timothycrosley Please clarify the help text for --settings-path. Altenatively, allow us to specify a config file directly (e.g. --config=path/to/config.cfg)

All 3 comments

Okay I see what is happening here. Settings path option specifies the directory in which to search for the configuration file, not the file itself.

So I had to rename isort.conf to .isort.cfg, and optionally change the command to isort --settings-path config --check-only --recursive src (optionally because if the given argument exists but is not a directory, isort will dirname it, so it works just the same).

This behavior feels a bit weird to me. Is there a benefit to specifying the directory path (to search the configuration file) instead of the file path directly?

This isn't remotely clear in the option's documentation. @timothycrosley Please clarify the help text for --settings-path. Altenatively, allow us to specify a config file directly (e.g. --config=path/to/config.cfg)

This is fixed in develop and will make it's way out in the 5.0.0 release.

Thanks!

~Timothy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

whg517 picture whg517  路  3Comments

peteboothroyd picture peteboothroyd  路  3Comments

jack1142 picture jack1142  路  3Comments

johnthagen picture johnthagen  路  3Comments

and-semakin picture and-semakin  路  3Comments