From 07d13c6b4a9acdfac3fbce314ee50685d0e8df0d Mon Sep 17 00:00:00 2001 From: Nikolas Hearp <154913660+njhearp@users.noreply.github.com> Date: Sat, 23 Nov 2024 02:45:28 -0500 Subject: [PATCH] [B028-doc-update] Update documentation for B028 (#14338) ## Summary Resolves #14289 The documentation for B028 no_explicit_stacklevel is updated to be more clear. --------- Co-authored-by: dylwil3 --- .../rules/flake8_bugbear/rules/no_explicit_stacklevel.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/no_explicit_stacklevel.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/no_explicit_stacklevel.rs index 1eb1355a4e..45d0b7b8be 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/no_explicit_stacklevel.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/no_explicit_stacklevel.rs @@ -11,10 +11,11 @@ use crate::checkers::ast::Checker; /// /// ## Why is this bad? /// The `warnings.warn` method uses a `stacklevel` of 1 by default, which -/// limits the rendered stack trace to that of the line on which the -/// `warn` method is called. +/// will output a stack frame of the line on which the "warn" method +/// is called. Setting it to a higher number will output a stack frame +/// from higher up the stack. /// -/// It's recommended to use a `stacklevel` of 2 or higher, give the caller +/// It's recommended to use a `stacklevel` of 2 or higher, to give the caller /// more context about the warning. /// /// ## Example