Skip to content

Commit

Permalink
Document link between import sorting and formatter (#9117)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluthej authored Dec 15, 2023
1 parent c8d6958 commit db38078
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,15 @@ flag.
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)
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).

0 comments on commit db38078

Please sign in to comment.