From 8b5daaec7d11bd22e812948974b279a4432ee21c Mon Sep 17 00:00:00 2001 From: Greenstar <39073901+greenstar1151@users.noreply.github.com> Date: Fri, 1 Mar 2024 20:35:29 +0900 Subject: [PATCH] Fix broken documentation links affected by namespace changes in lint rules (#10182) --- .../ruff/rules/ambiguous_unicode_character.rs | 4 ++-- docs/faq.md | 14 +++++++------- docs/linter.md | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ruff_linter/src/rules/ruff/rules/ambiguous_unicode_character.rs b/crates/ruff_linter/src/rules/ruff/rules/ambiguous_unicode_character.rs index b3600d62fd..2a228f1a4c 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/ambiguous_unicode_character.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/ambiguous_unicode_character.rs @@ -83,7 +83,7 @@ impl Violation for AmbiguousUnicodeCharacterString { /// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`. /// /// You can omit characters from being flagged as ambiguous via the -/// [`allowed-confusables`] setting. +/// [`lint.allowed-confusables`] setting. /// /// ## Example /// ```python @@ -136,7 +136,7 @@ impl Violation for AmbiguousUnicodeCharacterDocstring { /// spec recommends `GREEK CAPITAL LETTER OMEGA` over `OHM SIGN`. /// /// You can omit characters from being flagged as ambiguous via the -/// [`allowed-confusables`] setting. +/// [`lint.allowed-confusables`] setting. /// /// ## Example /// ```python diff --git a/docs/faq.md b/docs/faq.md index fe4b0b0ab1..5d62ec4f95 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -261,8 +261,8 @@ from numpy import tan, uint8, uint16, uint32, uint64 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 -them. You can find the supported settings in the [API reference](settings.md#isort). -For example, you can set [`known-first-party`](settings.md#isort-known-first-party) +them. You can find the supported settings in the [API reference](settings.md#lintisort). +For example, you can set [`known-first-party`](settings.md#lint_isort_known-first-party) like so: === "pyproject.toml" @@ -426,7 +426,7 @@ Found 3 errors. ## 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: === "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`, 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: === "pyproject.toml" @@ -470,7 +470,7 @@ explicitly enable the `D` rule code prefix, since the `D` rules are not enabled 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 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 [`D413`](rules/no-blank-line-after-section.md). -By default, no [`convention`](settings.md#pydocstyle-convention) is set, and so the enabled rules -are determined by the [`select`](settings.md#select) setting alone. +By default, no [`convention`](settings.md#lint_pydocstyle_convention) is set, and so the enabled rules +are determined by the [`select`](settings.md#lint_select) setting alone. ## What is "preview"? diff --git a/docs/linter.md b/docs/linter.md index 13f791db10..a0119c2e01 100644 --- a/docs/linter.md +++ b/docs/linter.md @@ -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 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: