From 5b4c8a7c5fd806d1ca6aaa40780f8574f86a4a1a Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:17:47 +1000 Subject: [PATCH] =?UTF-8?q?(=F0=9F=93=9A)=20fix=20docs=20for=20`invalid-X-?= =?UTF-8?q?returns`=20(#11094)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary There is no class `integer` in python, nor is there a type `integer`, so I updated the docs to remove the backticks on these references, such that it is the representation of an integer, and not a reference. --- .../ruff_linter/src/rules/pylint/rules/invalid_hash_return.rs | 4 ++-- .../src/rules/pylint/rules/invalid_index_return.rs | 4 ++-- .../src/rules/pylint/rules/invalid_length_return.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ruff_linter/src/rules/pylint/rules/invalid_hash_return.rs b/crates/ruff_linter/src/rules/pylint/rules/invalid_hash_return.rs index fe585ccf5d..1a32228c50 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/invalid_hash_return.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/invalid_hash_return.rs @@ -12,10 +12,10 @@ use ruff_text_size::Ranged; use crate::checkers::ast::Checker; /// ## What it does -/// Checks for `__hash__` implementations that return a type other than `integer`. +/// Checks for `__hash__` implementations that return a value other than an integer. /// /// ## Why is this bad? -/// The `__hash__` method should return an `integer`. Returning a different +/// The `__hash__` method should return an integer. Returning a different /// type may cause unexpected behavior. /// /// Note: `bool` is a subclass of `int`, so it's technically valid for `__hash__` to diff --git a/crates/ruff_linter/src/rules/pylint/rules/invalid_index_return.rs b/crates/ruff_linter/src/rules/pylint/rules/invalid_index_return.rs index 14fe3dd791..d92ee4a259 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/invalid_index_return.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/invalid_index_return.rs @@ -12,10 +12,10 @@ use ruff_text_size::Ranged; use crate::checkers::ast::Checker; /// ## What it does -/// Checks for `__index__` implementations that return a type other than `integer`. +/// Checks for `__index__` implementations that return a value other than an integer. /// /// ## Why is this bad? -/// The `__index__` method should return an `integer`. Returning a different +/// The `__index__` method should return an integer. Returning a different /// type may cause unexpected behavior. /// /// Note: `bool` is a subclass of `int`, so it's technically valid for `__index__` to diff --git a/crates/ruff_linter/src/rules/pylint/rules/invalid_length_return.rs b/crates/ruff_linter/src/rules/pylint/rules/invalid_length_return.rs index d3b9c137ab..e36984c24a 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/invalid_length_return.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/invalid_length_return.rs @@ -13,10 +13,10 @@ use crate::checkers::ast::Checker; /// ## What it does /// Checks for `__len__` implementations that return values other than a non-negative -/// `integer`. +/// integer. /// /// ## Why is this bad? -/// The `__len__` method should return a non-negative `integer`. Returning a different +/// The `__len__` method should return a non-negative integer. Returning a different /// value may cause unexpected behavior. /// /// Note: `bool` is a subclass of `int`, so it's technically valid for `__len__` to