mirror of https://github.com/astral-sh/ruff
Convert `.md` links in rule documentation to full URLs (#15904)
This commit is contained in:
parent
9c64d65552
commit
dfe1b849d0
|
|
@ -113,9 +113,9 @@ impl Violation for UnquotedTypeAlias {
|
||||||
/// This rule only applies to type aliases in non-stub files. For removing quotes in other
|
/// This rule only applies to type aliases in non-stub files. For removing quotes in other
|
||||||
/// contexts or in stub files, see:
|
/// contexts or in stub files, see:
|
||||||
///
|
///
|
||||||
/// - [`quoted-annotation-in-stub`](quoted-annotation-in-stub.md): A rule that
|
/// - [`quoted-annotation-in-stub`][PYI020]: A rule that
|
||||||
/// removes all quoted annotations from stub files
|
/// removes all quoted annotations from stub files
|
||||||
/// - [`quoted-annotation`](quoted-annotation.md): A rule that removes unnecessary quotes
|
/// - [`quoted-annotation`][UP037]: A rule that removes unnecessary quotes
|
||||||
/// from *annotations* in runtime files.
|
/// from *annotations* in runtime files.
|
||||||
///
|
///
|
||||||
/// ## References
|
/// ## References
|
||||||
|
|
@ -126,6 +126,8 @@ impl Violation for UnquotedTypeAlias {
|
||||||
/// [PEP 604]: https://peps.python.org/pep-0604/
|
/// [PEP 604]: https://peps.python.org/pep-0604/
|
||||||
/// [PEP 613]: https://peps.python.org/pep-0613/
|
/// [PEP 613]: https://peps.python.org/pep-0613/
|
||||||
/// [PEP 695]: https://peps.python.org/pep-0695/#generic-type-alias
|
/// [PEP 695]: https://peps.python.org/pep-0695/#generic-type-alias
|
||||||
|
/// [PYI020]: https://docs.astral.sh/ruff/rules/quoted-annotation-in-stub/
|
||||||
|
/// [UP037]: https://docs.astral.sh/ruff/rules/quoted-annotation/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
pub(crate) struct QuotedTypeAlias;
|
pub(crate) struct QuotedTypeAlias;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,19 +62,22 @@ use super::{check_type_vars, in_nested_context, DisplayTypeVars, TypeVarReferenc
|
||||||
///
|
///
|
||||||
/// This rule replaces standalone type variables in classes but doesn't remove
|
/// This rule replaces standalone type variables in classes but doesn't remove
|
||||||
/// the corresponding type variables even if they are unused after the fix. See
|
/// the corresponding type variables even if they are unused after the fix. See
|
||||||
/// [`unused-private-type-var`](unused-private-type-var.md) for a rule to clean up unused
|
/// [`unused-private-type-var`][PYI018] for a rule to clean up unused
|
||||||
/// private type variables.
|
/// private type variables.
|
||||||
///
|
///
|
||||||
/// This rule will correctly handle classes with multiple base classes, as long as the single
|
/// This rule will correctly handle classes with multiple base classes, as long as the single
|
||||||
/// `Generic` base class is at the end of the argument list, as checked by
|
/// `Generic` base class is at the end of the argument list, as checked by
|
||||||
/// [`generic-not-last-base-class`](generic-not-last-base-class.md). If a `Generic` base class is
|
/// [`generic-not-last-base-class`][PYI059]. If a `Generic` base class is
|
||||||
/// found outside of the last position, a diagnostic is emitted without a suggested fix.
|
/// found outside of the last position, a diagnostic is emitted without a suggested fix.
|
||||||
///
|
///
|
||||||
/// This rule only applies to generic classes and does not include generic functions. See
|
/// This rule only applies to generic classes and does not include generic functions. See
|
||||||
/// [`non-pep695-generic-function`](non-pep695-generic-function.md) for the function version.
|
/// [`non-pep695-generic-function`][PYI059] for the function version.
|
||||||
///
|
///
|
||||||
/// [PEP 695]: https://peps.python.org/pep-0695/
|
/// [PEP 695]: https://peps.python.org/pep-0695/
|
||||||
/// [PEP 696]: https://peps.python.org/pep-0696/
|
/// [PEP 696]: https://peps.python.org/pep-0696/
|
||||||
|
/// [PYI018]: https://docs.astral.sh/ruff/rules/unused-private-type-var/
|
||||||
|
/// [PYI059]: https://docs.astral.sh/ruff/rules/generic-not-last-base-class/
|
||||||
|
/// [PYI059]: https://docs.astral.sh/ruff/rules/non-pep695-generic-function/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
pub(crate) struct NonPEP695GenericClass {
|
pub(crate) struct NonPEP695GenericClass {
|
||||||
name: String,
|
name: String,
|
||||||
|
|
|
||||||
|
|
@ -61,14 +61,16 @@ use super::{check_type_vars, in_nested_context, DisplayTypeVars, TypeVarReferenc
|
||||||
///
|
///
|
||||||
/// This rule replaces standalone type variables in function signatures but doesn't remove
|
/// This rule replaces standalone type variables in function signatures but doesn't remove
|
||||||
/// the corresponding type variables even if they are unused after the fix. See
|
/// the corresponding type variables even if they are unused after the fix. See
|
||||||
/// [`unused-private-type-var`](unused-private-type-var.md) for a rule to clean up unused
|
/// [`unused-private-type-var`][PYI018] for a rule to clean up unused
|
||||||
/// private type variables.
|
/// private type variables.
|
||||||
///
|
///
|
||||||
/// This rule only applies to generic functions and does not include generic classes. See
|
/// This rule only applies to generic functions and does not include generic classes. See
|
||||||
/// [`non-pep695-generic-class`](non-pep695-generic-class.md) for the class version.
|
/// [`non-pep695-generic-class`][UP046] for the class version.
|
||||||
///
|
///
|
||||||
/// [PEP 695]: https://peps.python.org/pep-0695/
|
/// [PEP 695]: https://peps.python.org/pep-0695/
|
||||||
/// [PEP 696]: https://peps.python.org/pep-0696/
|
/// [PEP 696]: https://peps.python.org/pep-0696/
|
||||||
|
/// [PYI018]: https://docs.astral.sh/ruff/rules/unused-private-type-var/
|
||||||
|
/// [UP046]: https://docs.astral.sh/ruff/rules/non-pep695-generic-class/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
pub(crate) struct NonPEP695GenericFunction {
|
pub(crate) struct NonPEP695GenericFunction {
|
||||||
name: String,
|
name: String,
|
||||||
|
|
|
||||||
|
|
@ -58,14 +58,17 @@ use ruff_source_file::LineRanges;
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## See also
|
/// ## See also
|
||||||
/// - [`quoted-annotation-in-stub`](quoted-annotation-in-stub.md): A rule that
|
/// - [`quoted-annotation-in-stub`][PYI020]: A rule that
|
||||||
/// removes all quoted annotations from stub files
|
/// removes all quoted annotations from stub files
|
||||||
/// - [`quoted-type-alias`](quoted-type-alias.md): A rule that removes unnecessary quotes
|
/// - [`quoted-type-alias`][TC008]: A rule that removes unnecessary quotes
|
||||||
/// from type aliases.
|
/// from type aliases.
|
||||||
///
|
///
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [PEP 563 – Postponed Evaluation of Annotations](https://peps.python.org/pep-0563/)
|
/// - [PEP 563 – Postponed Evaluation of Annotations](https://peps.python.org/pep-0563/)
|
||||||
/// - [Python documentation: `__future__`](https://docs.python.org/3/library/__future__.html#module-__future__)
|
/// - [Python documentation: `__future__`](https://docs.python.org/3/library/__future__.html#module-__future__)
|
||||||
|
///
|
||||||
|
/// [PYI020]: https://docs.astral.sh/ruff/rules/quoted-annotation-in-stub/
|
||||||
|
/// [TC008]: https://docs.astral.sh/ruff/rules/quoted-type-alias/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
pub(crate) struct QuotedAnnotation;
|
pub(crate) struct QuotedAnnotation;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue