mirror of https://github.com/astral-sh/ruff
Add missing config tabs (#8558)
This commit is contained in:
parent
3956f38999
commit
0ea1076f85
|
|
@ -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,6 +326,8 @@ 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:
|
||||
|
||||
=== "pyproject.toml"
|
||||
|
||||
```toml
|
||||
[tool.ruff]
|
||||
extend-include = ["*.ipynb"]
|
||||
|
|
@ -334,8 +336,19 @@ extend-include = ["*.ipynb"]
|
|||
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:
|
||||
|
||||
=== "pyproject.toml"
|
||||
|
||||
```toml
|
||||
[tool.ruff]
|
||||
extend-include = ["*.ipynb"]
|
||||
|
|
@ -344,6 +357,15 @@ extend-include = ["*.ipynb"]
|
|||
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,
|
||||
`ruff format /path/to/notebook.ipynb` will always format `notebook.ipynb`.
|
||||
|
|
|
|||
Loading…
Reference in New Issue