From 434b0befe0f0c75bab850b0308f924ea0cf94c0d Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 26 Oct 2023 12:23:12 -0400 Subject: [PATCH] Clarify unsafe case in RSE102 --- .../rules/unnecessary_paren_on_raise_exception.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs b/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs index ad8cebf7bad6e..2fde8e5a8f320 100644 --- a/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs +++ b/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs @@ -19,9 +19,12 @@ use crate::checkers::ast::Checker; /// ## Known problems /// Parentheses can only be omitted if the exception is a class, as opposed to /// a function call. This rule isn't always capable of distinguishing between -/// the two. For example, if you define a method `get_exception` that itself -/// returns an exception object, this rule will falsy mark the parentheses -/// in `raise get_exception()` as unnecessary. +/// the two. +/// +/// For example, if you import a function `module.get_exception` from another +/// module, and `module.get_exception` returns an exception object, this rule will +/// incorrectly mark the parentheses in `raise module.get_exception()` as +/// unnecessary. /// /// ## Example /// ```python