From e8ff02eadcf9d1ed34cbc49b8fabe17a18351fe1 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 6 Jan 2025 21:44:39 -0500 Subject: [PATCH] Don't enforce object-without-hash-method in stubs --- crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs b/crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs index 616da209584aa..b0a03cda3e769 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs @@ -111,6 +111,9 @@ impl Violation for EqWithoutHash { /// W1641 pub(crate) fn object_without_hash_method(checker: &mut Checker, class: &StmtClassDef) { + if checker.source_type.is_stub() { + return; + } let eq_hash = EqHash::from_class(class); if matches!( eq_hash,