Skip to content

Commit

Permalink
Add -k to upgrading guide
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 15, 2020
1 parent 0d37ec2 commit 413f8a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/upgrade_guides/5.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).

Expand All @@ -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.
Expand Down

0 comments on commit 413f8a0

Please sign in to comment.