[pep8-naming] Add links to ignore-names options in various rules' documentation (#16557)

## Summary

Resolves #16551.

All rules using
[`lint.pep8-naming.ignore-names`](https://docs.astral.sh/ruff/settings/#lint_pep8-naming_ignore-names)
and
[`lint.pep8-naming.extend-ignore-names`](https://docs.astral.sh/ruff/settings/#lint_pep8-naming_extend-ignore-names)
now have their documentation linked to these two options.

## Test Plan

None.
This commit is contained in:
InSync
2025-03-08 02:49:08 +07:00
committed by GitHub
parent 348c196cb3
commit a18d8bfa7d
11 changed files with 42 additions and 0 deletions

View File

@@ -37,6 +37,8 @@ use crate::rules::pep8_naming::helpers;
///
/// ## Options
/// - `lint.flake8-import-conventions.aliases`
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]

View File

@@ -44,6 +44,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// A common example of a single uppercase character being used for a class
/// name can be found in Django's `django.db.models.Q` class.
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]
pub(crate) struct CamelcaseImportedAsConstant {

View File

@@ -29,6 +29,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// from example import MyClassName
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]
pub(crate) struct CamelcaseImportedAsLowercase {

View File

@@ -42,6 +42,10 @@ use crate::rules::pep8_naming::{helpers, settings::IgnoreNames};
/// A common example of a single uppercase character being used for a class
/// name can be found in Django's `django.db.models.Q` class.
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]
pub(crate) struct ConstantImportedAsNonConstant {

View File

@@ -31,6 +31,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// pass
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]
pub(crate) struct DunderFunctionName;

View File

@@ -28,6 +28,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// class ValidationError(Exception): ...
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/#exception-names
#[derive(ViolationMetadata)]
pub(crate) struct ErrorSuffixOnExceptionName {

View File

@@ -37,6 +37,10 @@ use crate::checkers::ast::Checker;
/// pass
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/#function-and-method-arguments
/// [preview]: https://docs.astral.sh/ruff/preview/
#[derive(ViolationMetadata)]

View File

@@ -34,6 +34,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// pass
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/#class-names
#[derive(ViolationMetadata)]
pub(crate) struct InvalidClassName {

View File

@@ -28,6 +28,10 @@ use crate::rules::pep8_naming::settings::IgnoreNames;
/// from example import myclassname
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/
#[derive(ViolationMetadata)]
pub(crate) struct LowercaseImportedAsNonLowercase {

View File

@@ -35,6 +35,10 @@ use crate::rules::pep8_naming::helpers;
/// another_variable = "world"
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/#function-and-method-arguments
#[derive(ViolationMetadata)]
pub(crate) struct MixedCaseVariableInClassScope {

View File

@@ -46,6 +46,10 @@ use crate::rules::pep8_naming::helpers;
/// yet_another_variable = "foo"
/// ```
///
/// ## Options
/// - `lint.pep8-naming.ignore-names`
/// - `lint.pep8-naming.extend-ignore-names`
///
/// [PEP 8]: https://peps.python.org/pep-0008/#global-variable-names
#[derive(ViolationMetadata)]
pub(crate) struct MixedCaseVariableInGlobalScope {