Add missing config tabs (#8558)

This commit is contained in:
doolio 2023-11-09 02:49:06 +01:00 committed by GitHub
parent 3956f38999
commit 0ea1076f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 15 deletions

View File

@ -208,9 +208,9 @@ Linter plugin configurations are expressed as subsections, e.g.:
docstring-quotes = "double"
```
Ruff respects `pyproject.toml`, `ruff.toml`, and `.ruff.toml` files. All three implement
an equivalent schema (though in the `ruff.toml` and `.ruff.toml` versions, the
`[tool.ruff]` header is omitted).
Ruff respects `pyproject.toml`, `ruff.toml`, and `.ruff.toml` files. All three implement an
equivalent schema (though in the `ruff.toml` and `.ruff.toml` versions, the `[tool.ruff]` header and
`tool.ruff` section prefix is omitted).
For a complete enumeration of the available configuration options, see [_Settings_](settings.md).
@ -326,23 +326,45 @@ If you'd prefer to either only lint or only format Jupyter Notebook files, you c
section specific `exclude` option to do so. For example, the following would only lint Jupyter
Notebook files and not format them:
```toml
[tool.ruff]
extend-include = ["*.ipynb"]
=== "pyproject.toml"
[tool.ruff.format]
exclude = ["*.ipynb"]
```
```toml
[tool.ruff]
extend-include = ["*.ipynb"]
[tool.ruff.format]
exclude = ["*.ipynb"]
```
=== "ruff.toml"
```toml
extend-include = ["*.ipynb"]
[format]
exclude = ["*.ipynb"]
```
And, conversely, the following would only format Jupyter Notebook files and not lint them:
```toml
[tool.ruff]
extend-include = ["*.ipynb"]
=== "pyproject.toml"
[tool.ruff.lint]
exclude = ["*.ipynb"]
```
```toml
[tool.ruff]
extend-include = ["*.ipynb"]
[tool.ruff.lint]
exclude = ["*.ipynb"]
```
=== "ruff.toml"
```toml
extend-include = ["*.ipynb"]
[lint]
exclude = ["*.ipynb"]
```
Alternatively, pass the notebook file(s) to `ruff` on the command-line directly. For example,
`ruff check /path/to/notebook.ipynb` will always lint `notebook.ipynb`. Similarly,