Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Sep 14, 2023
1 parent 91283e5 commit 7884eac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,20 @@ preview = true
Or, if you provided the `--preview` CLI flag.

To see which rules are currently in preview, visit the [rules reference](https://beta.ruff.rs/docs/rules/).

## Selecting single preview rules

When preview mode is enabled, selecting rule categories or prefixes will include all preview rules that match.
If you would prefer to opt-in to each preview rule individually, you can toggle the `explicit-preview-rules`
setting in your `pyproject.toml`:

```toml
[tool.ruff]
preview = true
explicit-preview-rules = true
```

In our previous example, `--select` with `ALL` `HYP`, `HYP0`, or `HYP00` would not enable `HYP001`. Each preview
rule will need to be selected with its exact code, e.g. `--select ALL,HYP001`.

If preview mode is not enabled, this setting has no effect.

0 comments on commit 7884eac

Please sign in to comment.