From 46d5db56cc2f1e7b71cfd67422d2f57370435f86 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 19 Oct 2023 08:30:30 +0900 Subject: [PATCH] Document `lint.preview` and `format.preview` (#8032) Co-authored-by: Zanie Blue --- docs/preview.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/preview.md b/docs/preview.md index d3573a3615..169a8d5a2d 100644 --- a/docs/preview.md +++ b/docs/preview.md @@ -10,6 +10,20 @@ Preview mode enables a collection of newer rules and fixes that are considered e Preview mode can be enabled with the `--preview` flag on the CLI or by setting `preview = true` in your Ruff configuration file (e.g. `pyproject.toml`). +Preview mode can be configured separately for linting and formatting (requires Ruff v0.1.1+). To enable preview lint rules without preview style formatting: + +```toml +[lint] +preview = true +``` + +To enable preview style formatting without enabling any preview lint rules: + +```toml +[format] +preview = true +``` + ## Using rules that are in preview If a rule is marked as preview, it can only be selected if preview mode is enabled. For example, consider a