Fix broken documentation links affected by namespace changes in lint rules (#10182)

This commit is contained in:
Greenstar 2024-03-01 20:35:29 +09:00 committed by GitHub
parent 0373b51823
commit 8b5daaec7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View file

@ -83,7 +83,7 @@ impl Violation for AmbiguousUnicodeCharacterString {
/// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`. /// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`.
/// ///
/// You can omit characters from being flagged as ambiguous via the /// You can omit characters from being flagged as ambiguous via the
/// [`allowed-confusables`] setting. /// [`lint.allowed-confusables`] setting.
/// ///
/// ## Example /// ## Example
/// ```python /// ```python
@ -136,7 +136,7 @@ impl Violation for AmbiguousUnicodeCharacterDocstring {
/// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`. /// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`.
/// ///
/// You can omit characters from being flagged as ambiguous via the /// You can omit characters from being flagged as ambiguous via the
/// [`allowed-confusables`] setting. /// [`lint.allowed-confusables`] setting.
/// ///
/// ## Example /// ## Example
/// ```python /// ```python

View file

@ -261,8 +261,8 @@ from numpy import tan, uint8, uint16, uint32, uint64
Like isort, Ruff's import sorting is compatible with Black. Like isort, Ruff's import sorting is compatible with Black.
Ruff does not yet support all of isort's configuration options, though it does support many of Ruff does not yet support all of isort's configuration options, though it does support many of
them. You can find the supported settings in the [API reference](settings.md#isort). them. You can find the supported settings in the [API reference](settings.md#lintisort).
For example, you can set [`known-first-party`](settings.md#isort-known-first-party) For example, you can set [`known-first-party`](settings.md#lint_isort_known-first-party)
like so: like so:
=== "pyproject.toml" === "pyproject.toml"
@ -426,7 +426,7 @@ Found 3 errors.
## Does Ruff support NumPy- or Google-style docstrings? ## Does Ruff support NumPy- or Google-style docstrings?
Yes! To enforce a docstring convention, add a [`convention`](settings.md#pydocstyle-convention) Yes! To enforce a docstring convention, add a [`convention`](settings.md#lint_pydocstyle_convention)
setting following to your configuration file: setting following to your configuration file:
=== "pyproject.toml" === "pyproject.toml"
@ -447,7 +447,7 @@ For example, if you're coming from flake8-docstrings, and your originating confi
`--docstring-convention=numpy`, you'd instead set `convention = "numpy"` in your `pyproject.toml`, `--docstring-convention=numpy`, you'd instead set `convention = "numpy"` in your `pyproject.toml`,
as above. as above.
Alongside [`convention`](settings.md#pydocstyle-convention), you'll want to Alongside [`convention`](settings.md#lint_pydocstyle_convention), you'll want to
explicitly enable the `D` rule code prefix, since the `D` rules are not enabled by default: explicitly enable the `D` rule code prefix, since the `D` rules are not enabled by default:
=== "pyproject.toml" === "pyproject.toml"
@ -470,7 +470,7 @@ explicitly enable the `D` rule code prefix, since the `D` rules are not enabled
convention = "google" convention = "google"
``` ```
Enabling a [`convention`](settings.md#pydocstyle-convention) will disable any rules that are not Enabling a [`convention`](settings.md#lint_pydocstyle_convention) will disable any rules that are not
included in the specified convention. As such, the intended workflow is to enable a convention and included in the specified convention. As such, the intended workflow is to enable a convention and
then selectively enable or disable any additional rules on top of it: then selectively enable or disable any additional rules on top of it:
@ -556,8 +556,8 @@ The Google convention includes all `D` errors apart from:
[`D409`](rules/section-underline-matches-section-length.md), and [`D409`](rules/section-underline-matches-section-length.md), and
[`D413`](rules/no-blank-line-after-section.md). [`D413`](rules/no-blank-line-after-section.md).
By default, no [`convention`](settings.md#pydocstyle-convention) is set, and so the enabled rules By default, no [`convention`](settings.md#lint_pydocstyle_convention) is set, and so the enabled rules
are determined by the [`select`](settings.md#select) setting alone. are determined by the [`select`](settings.md#lint_select) setting alone.
## What is "preview"? ## What is "preview"?

View file

@ -206,7 +206,7 @@ ruff check . --fix --unsafe-fixes
By default, Ruff will display a hint when unsafe fixes are available but not enabled. The suggestion can be silenced By default, Ruff will display a hint when unsafe fixes are available but not enabled. The suggestion can be silenced
by setting the [`unsafe-fixes`](settings.md#unsafe-fixes) setting to `false` or using the `--no-unsafe-fixes` flag. by setting the [`unsafe-fixes`](settings.md#unsafe-fixes) setting to `false` or using the `--no-unsafe-fixes` flag.
The safety of fixes can be adjusted per rule using the [`extend-safe-fixes`](settings.md#extend-safe-fixes) and [`extend-unsafe-fixes`](settings.md#extend-unsafe-fixes) settings. The safety of fixes can be adjusted per rule using the [`lint.extend-safe-fixes`](settings.md#lint_extend-safe-fixes) and [`lint.extend-unsafe-fixes`](settings.md#lint_extend-unsafe-fixes) settings.
For example, the following configuration would promote unsafe fixes for `F601` to safe fixes and demote safe fixes for `UP034` to unsafe fixes: For example, the following configuration would promote unsafe fixes for `F601` to safe fixes and demote safe fixes for `UP034` to unsafe fixes: