Document link between import sorting and formatter (#9117)

This commit is contained in:
Joffrey Bluthé 2023-12-15 11:47:19 +01:00 committed by GitHub
parent c8d6958d15
commit db38078ca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -392,3 +392,15 @@ flag.
Black promotes some of its preview styling to stable at the end of each year. Ruff will similarly Black promotes some of its preview styling to stable at the end of each year. Ruff will similarly
implement formatting changes under the [`preview`](https://docs.astral.sh/ruff/settings/#preview) implement formatting changes under the [`preview`](https://docs.astral.sh/ruff/settings/#preview)
flag, promoting them to stable through minor releases, in accordance with our [versioning policy](https://github.com/astral-sh/ruff/discussions/6998#discussioncomment-7016766). flag, promoting them to stable through minor releases, in accordance with our [versioning policy](https://github.com/astral-sh/ruff/discussions/6998#discussioncomment-7016766).
## Sorting imports
Currently, the Ruff formatter does not sort imports. In order to both sort imports and format,
call the Ruff linter and then the formatter:
```shell
ruff check --select I --fix .
ruff format .
```
A unified command for both linting and formatting is [planned](https://github.com/astral-sh/ruff/issues/8232).