Skip to content

Commit

Permalink
Merge pull request #1757 from anirudnits/issue/1755
Browse files Browse the repository at this point in the history
Issue/1755
  • Loading branch information
timothycrosley committed Jun 20, 2021
2 parents 3de1890 + 321b1db commit 37dcd46
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/configuration/black_compatibility.md
Expand Up @@ -7,7 +7,7 @@ Compatibility with black is very important to the isort project and comes baked
All that's required to use isort alongside black is to set the isort profile to "black".

!!! tip
Beyond the profile, it is common to set [skip_gitignore](https://pycqa.github.io/isort/docs/configuration/options/#skip-gitignore) (which is not enabled by default for isort as it requires git to be installed) and [line_length](https://pycqa.github.io/isort/docs/configuration/options/#skip-gitignore) as it is common to deviate from black's default of 88.
Beyond the profile, it is common to set [skip_gitignore](https://pycqa.github.io/isort/docs/configuration/options.html#skip-gitignore) (which is not enabled by default for isort as it requires git to be installed) and [line_length](https://pycqa.github.io/isort/docs/configuration/options.html#line-length) as it is common to deviate from black's default of 88.


## Using a config file (such as .isort.cfg)
Expand All @@ -23,7 +23,7 @@ profile = "black"
multi_line_output = 3
```

Read More about supported [config files](https://pycqa.github.io/isort/docs/configuration/config_files/).
Read More about supported [config files](https://pycqa.github.io/isort/docs/configuration/config_files.html).

## CLI

Expand Down Expand Up @@ -51,7 +51,7 @@ after_success:

```

See [built-in profiles](https://pycqa.github.io/isort/docs/configuration/profiles/) for more profiles.
See [built-in profiles](https://pycqa.github.io/isort/docs/configuration/profiles.html) for more profiles.

## Integration with pre-commit

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/config_files.md
Expand Up @@ -81,7 +81,7 @@ src_paths=isort,test

## Custom config files

Optionally, you can also create a config file with a custom name, or directly point isort to a config file that falls lower in the priority order, by using [--settings-file](https://pycqa.github.io/isort/docs/configuration/options/#settings-path).
Optionally, you can also create a config file with a custom name, or directly point isort to a config file that falls lower in the priority order, by using [--settings-file](https://pycqa.github.io/isort/docs/configuration/options.html#settings-path).
This can be useful, for instance, if you want to have one configuration for `.py` files and another for `.pyx` - while keeping the config files at the root of your repository.

!!! tip
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/custom_sections_and_ordering.md
Expand Up @@ -115,15 +115,15 @@ import b
from a import a # This will always appear below because it is a from import.
```

However, if you prefer to keep strict alphabetical sorting you can set [force sort within sections](https://pycqa.github.io/isort/docs/configuration/options/#force-sort-within-sections) to true. Resulting in:
However, if you prefer to keep strict alphabetical sorting you can set [force sort within sections](https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections) to true. Resulting in:


```python
from a import a # This will now appear at top because a appears in the alphabet before b
import b
```

You can even tell isort to always place from imports on top, instead of the default of placing them on bottom, using [from first](https://pycqa.github.io/isort/docs/configuration/options/#from-first).
You can even tell isort to always place from imports on top, instead of the default of placing them on bottom, using [from first](https://pycqa.github.io/isort/docs/configuration/options.html#from-first).

```python
from b import b # If from first is set to True, all from imports will be placed before non-from imports.
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/multi_line_output_modes.md
@@ -1,6 +1,6 @@
# Multi Line Output Modes

This [config option](https://pycqa.github.io/isort/docs/configuration/options/#multi-line-output) defines how from imports wrap when they extend past the line\_length
This [config option](https://pycqa.github.io/isort/docs/configuration/options.html#multi-line-output) defines how from imports wrap when they extend past the line\_length
limit and has 12 possible settings:

## 0 - Grid
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/options.md
Expand Up @@ -5,7 +5,7 @@ isort will disagree but commit to your way of formatting. To enable this, isort
how you want your imports sorted, organized, and formatted.

Too busy to build your perfect isort configuration? For curated common configurations, see isort's [built-in
profiles](https://pycqa.github.io/isort/docs/configuration/profiles/).
profiles](https://pycqa.github.io/isort/docs/configuration/profiles.html).

## Python Version

Expand Down
8 changes: 4 additions & 4 deletions docs/upgrade_guides/5.0.0.md
Expand Up @@ -6,7 +6,7 @@ This guide is meant to help migrate projects from using isort 4.x.x unto the 5.0
Related documentation:

* [isort 5.0.0 changelog](https://pycqa.github.io/isort/CHANGELOG/#500-penny-july-4-2020)
* [isort 5 release document](https://pycqa.github.io/isort/docs/major_releases/introducing_isort_5/)
* [isort 5 release document](https://pycqa.github.io/isort/docs/major_releases/introducing_isort_5.html)

!!! important - "If you use pre-commit remove seed-isort-config."
If you currently use pre-commit, make sure to see the pre-commit section of this document. In particular, make sure to remove any `seed-isort-config` pre-step.
Expand All @@ -19,7 +19,7 @@ for those of us who have gotten used to placing imports right above their usage

If you want to move all imports to the top, you can use the new`--float-to-top` flag in the CLI or `float_to_top=true` option in your config file.

See: [https://pycqa.github.io/isort/docs/configuration/options/#float-to-top](https://pycqa.github.io/isort/docs/configuration/options/#float-to-top)
See: [https://pycqa.github.io/isort/docs/configuration/options.html#float-to-top](https://pycqa.github.io/isort/docs/configuration/options.html#float-to-top)

## Migrating CLI options

Expand All @@ -46,7 +46,7 @@ The `-v` (previously for version now for verbose) and `-V` (previously for verbo

The first thing to keep in mind is how isort loads config options has changed in isort 5. It will no longer merge multiple config files, instead you must have 1 isort config per a project.
If you have multiple configs, they will need to be merged into 1 single one. You can see the priority order of configuration files and the manner in which they are loaded on the
[config files documentation page](https://pycqa.github.io/isort/docs/configuration/config_files/).
[config files documentation page](https://pycqa.github.io/isort/docs/configuration/config_files.html).

!!! tip - "Config options are loaded relative to the file, not the isort instance."
isort looks for a config file based on the path of the file you request to sort. If you have your config placed outside of the project, you can use `--settings-path` to manually specify the config location instead. Full information about how config files are loaded is in the linked config files documentation page.
Expand All @@ -62,7 +62,7 @@ The option was originally added to allow working around this, and was then turne
### `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.
In isort 5, you can still get this behavior by moving your extra modules from the `known_standard_library` setting to [`extra_standard_library`](https://pycqa.github.io/isort/docs/configuration/options/#extra-standard-library).
In isort 5, you can still get this behavior by moving your extra modules from the `known_standard_library` setting to [`extra_standard_library`](https://pycqa.github.io/isort/docs/configuration/options.html#extra-standard-library).

### module placement changes: `known_third_party`, `known_first_party`, `default_section`, etc...
isort has completely rewritten its logic for placing modules in 5.0.0 to ensure the same behavior across environments. You can see the details of this change [here](https://github.com/pycqa/isort/issues/1147).
Expand Down

0 comments on commit 37dcd46

Please sign in to comment.