diff options
| author | Timothy Crosley <timothy.crosley@gmail.com> | 2020-07-14 21:27:26 -0700 |
|---|---|---|
| committer | Timothy Crosley <timothy.crosley@gmail.com> | 2020-07-14 21:27:26 -0700 |
| commit | 413f8a0f8c1cba07b2a174fdd03c8bf279198d3b (patch) | |
| tree | b9d031ac5e518fba2e79efecd2defd590ae4f47a /docs/upgrade_guides | |
| parent | 0d37ec2af515501cae1516ab3aa03794ebbf5215 (diff) | |
| download | isort-413f8a0f8c1cba07b2a174fdd03c8bf279198d3b.tar.gz | |
Add -k to upgrading guide
Diffstat (limited to 'docs/upgrade_guides')
| -rw-r--r-- | docs/upgrade_guides/5.0.0.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/upgrade_guides/5.0.0.md b/docs/upgrade_guides/5.0.0.md index 4724695c..b3d788ef 100644 --- a/docs/upgrade_guides/5.0.0.md +++ b/docs/upgrade_guides/5.0.0.md @@ -19,6 +19,10 @@ Prior to version 5.0.0, isort wouldn't automatically traverse directories. The - ### `--apply` or `-y` Prior to version 5.0.0, depending on how isort was executed, it would ask you before making every file change. In isort 5.0.0 file changes happen by default inline with other formatters. `--interactive` is available to restore the previous behavior. If encountered this option can simply be removed. +### `--keep-direct-and-as` or `-k` +Many versions ago, by default isort would remove imports such as `from datetime import datetime` if an alias for the same import also existed such as `from datetime import datetime as dt` - never allowing both to exist. +The option was originally added to allow working around this, and was then turned on as the default. Now the option for the old behaviour has been removed. Simply remove the option from your config file. + ### `-ac`, `-wl`, `-ws`, `-tc`, `-sp`, `-sp`, `-sl`, `-sg`, `-sd`, `-rr`, `-ot`, `-nlb`, `-nis`, `-ls`, `-le`, `-lbt`, `-lai`, `-fss`, `-fgw`, `-ff`, `-fass`, `-fas`, `-dt`, `-ds`, `-df`, `-cs`, `-ca`, `-af`, `-ac` Two-letter shortened setting names (like `ac` for `atomic`) now require two dashes to avoid ambiguity. Simply add another dash before the option, or switch to the long form option to fix (example: `--ac` or `--atomic`). @@ -31,6 +35,10 @@ If you have multiple configs, they will need to be merged into 1 single one. You ### `not_skip` This is the same as the `--dont-skip` CLI option above. In an earlier version isort had a default skip of `__init__.py`. To get around that many projects wanted a way to not skip `__init__.py` or any other files that were automatically skipped in the future by isort. isort no longer has any default skips, so if the value here is `__init__.py` you can simply remove the setting. If it is something else, just make sure you aren't specifying to skip that file somewhere else in your config. +### `keep_direct_and_as_imports` +This is the same as `keep-direct-and-as` from CLI. Many versions ago, by default isort would remove imports such as `from datetime import datetime` if an alias for the same import also existed such as `from datetime import datetime as dt` - never allowing both to exist. +The option was originally added to allow working around this, and was then turned on as the default. Now the option for the old behaviour has been removed. Simply remove the option from your config file. + ### `known_standard_library` isort settings no longer merge together, instead they override. The old behavior of merging together caused many hard to track down errors, but the one place it was very convenient was for adding a few additional standard library modules. |
