From 0bc214cfe09a7bb49aaf00969bea5368349da46d Mon Sep 17 00:00:00 2001 From: bluthej Date: Wed, 13 Dec 2023 20:02:05 +0100 Subject: [PATCH 1/2] Document link between import sorting and formatter --- docs/formatter.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/formatter.md b/docs/formatter.md index 8c8537946862d..2179fafaa3ca8 100644 --- a/docs/formatter.md +++ b/docs/formatter.md @@ -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 currently [being developed](https://github.com/astral-sh/ruff/issues/8232). From cec4f27fd7f11dfcc4f867f6dabb8b54c03b021b Mon Sep 17 00:00:00 2001 From: bluthej Date: Fri, 15 Dec 2023 09:20:43 +0100 Subject: [PATCH 2/2] Rephrase sentence on the future unified cmd --- docs/formatter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatter.md b/docs/formatter.md index 2179fafaa3ca8..547f32eee25da 100644 --- a/docs/formatter.md +++ b/docs/formatter.md @@ -403,4 +403,4 @@ ruff check --select I --fix . ruff format . ``` -A unified command for both linting and formatting is currently [being developed](https://github.com/astral-sh/ruff/issues/8232). +A unified command for both linting and formatting is [planned](https://github.com/astral-sh/ruff/issues/8232).