Add a link to the nursery; tweak icons (#5637)

## Summary

We now always render the icons, but very faintly if inactive, and always
right-align. This ensures consistent alignment as you scroll down the
page:

<img width="1792" alt="Screen Shot 2023-07-09 at 10 45 50 PM"
src="https://github.com/astral-sh/ruff/assets/1309177/da47ac0e-d646-49e1-bbe1-9f43adf94bb4">
This commit is contained in:
Charlie Marsh
2023-07-09 23:09:08 -04:00
committed by GitHub
parent eb69fe37bf
commit c9d7c0d7d5
3 changed files with 54 additions and 11 deletions

View File

@@ -370,6 +370,38 @@ matter how they're provided, which avoids accidental incompatibilities and simpl
By default, no `convention` is set, and so the enabled rules are determined by the `select` setting
alone.
## What is the "nursery"?
The "nursery" is a collection of newer rules that are considered experimental or unstable.
If a rule is marked as part of the "nursery", it can only be enabled via direct selection. For
example, consider a hypothetical rule, `HYP001`. If `HYP001` were included in the "nursery", it
could be enabled by adding the following to your `pyproject.toml`:
```toml
[tool.ruff]
extend-select = ["HYP001"]
```
However, it would _not_ be enabled by selecting the `HYP` category, like so:
```toml
[tool.ruff]
extend-select = ["HYP"]
```
Similarly, it would _not_ be enabled via the `ALL` selector:
```toml
[tool.ruff]
select = ["ALL"]
```
(The "nursery" terminology comes from [Clippy](https://doc.rust-lang.org/nightly/clippy/), a similar
tool for linting Rust code.)
To see which rules are currently in the "nursery", visit the [rules reference](https://beta.ruff.rs/docs/rules/).
## How can I tell what settings Ruff is using to check my code?
Run `ruff check /path/to/code.py --show-settings` to view the resolved settings for a given file.