Skip to content

Commit

Permalink
Fix docs typo for ruff format preview configuration (#8611)
Browse files Browse the repository at this point in the history
## Summary

The ruff configuration section is called "format", rather than
"preview". Using the configuration as it was written in the docs gives
an error:

```
$ ruff format --check .
ruff failed
  Cause: TOML parse error at line 143, column 1
    |
143 | [tool.ruff.preview]
    | ^^^^^^^^^^^^^^^^^^^
invalid type: map, expected a boolean
```

## Test Plan

Tested running `ruff format` with the following in my `pyproject.toml`:

```toml
[tool.ruff.format]
preview = true
```

and it worked properly (using preview rules for formatting).
  • Loading branch information
sjdemartini committed Nov 11, 2023
1 parent 39728a1 commit d7144d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ To enable preview style formatting without enabling any preview lint rules:
=== "pyproject.toml"

```toml
[tool.ruff.preview]
[tool.ruff.format]
preview = true
```

=== "ruff.toml"

```toml
[preview]
[format]
preview = true
```

Expand Down

0 comments on commit d7144d6

Please sign in to comment.