Document lint.preview and format.preview (#8032)

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
Micha Reiser 2023-10-19 08:30:30 +09:00 committed by GitHub
parent 2729c4cacd
commit 46d5db56cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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