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"
|
docstring-quotes = "double"
|
||||||
```
|
```
|
||||||
|
|
||||||
Ruff respects `pyproject.toml`, `ruff.toml`, and `.ruff.toml` files. All three implement
|
Ruff respects `pyproject.toml`, `ruff.toml`, and `.ruff.toml` files. All three implement an
|
||||||
an equivalent schema (though in the `ruff.toml` and `.ruff.toml` versions, the
|
equivalent schema (though in the `ruff.toml` and `.ruff.toml` versions, the `[tool.ruff]` header and
|
||||||
`[tool.ruff]` header is omitted).
|
`tool.ruff` section prefix is omitted).
|
||||||
|
|
||||||
For a complete enumeration of the available configuration options, see [_Settings_](settings.md).
|
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
|
section specific `exclude` option to do so. For example, the following would only lint Jupyter
|
||||||
Notebook files and not format them:
|
Notebook files and not format them:
|
||||||
|
|
||||||
```toml
|
=== "pyproject.toml"
|
||||||
[tool.ruff]
|
|
||||||
extend-include = ["*.ipynb"]
|
|
||||||
|
|
||||||
[tool.ruff.format]
|
```toml
|
||||||
exclude = ["*.ipynb"]
|
[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:
|
And, conversely, the following would only format Jupyter Notebook files and not lint them:
|
||||||
|
|
||||||
```toml
|
=== "pyproject.toml"
|
||||||
[tool.ruff]
|
|
||||||
extend-include = ["*.ipynb"]
|
|
||||||
|
|
||||||
[tool.ruff.lint]
|
```toml
|
||||||
exclude = ["*.ipynb"]
|
[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,
|
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 check /path/to/notebook.ipynb` will always lint `notebook.ipynb`. Similarly,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue