Skip to content

Commit b342f60

Browse files
authored
Update T201 suggestion to not use root logger to satisfy LOG015 (#22059)
## Summary Currently, the proposed fix for https://docs.astral.sh/ruff/rules/print/ violates https://docs.astral.sh/ruff/rules/root-logger-call/. Thus, let's change the proposal to make LOG015 happy as well. ## Test Plan Test manually in a project that has both T201 and LOG015 enabled and run them over the previous and proposed code. Is there continuous testing of the code snippets from the docs?
1 parent 2151c3d commit b342f60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/ruff_linter/src/rules/flake8_print/rules/print_call.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ use crate::{Fix, FixAvailability, Violation};
3737
/// import logging
3838
///
3939
/// logging.basicConfig(level=logging.INFO)
40+
/// logger = logging.getLogger(__name__)
4041
///
4142
///
4243
/// def sum_less_than_four(a, b):
43-
/// logging.debug("Calling sum_less_than_four")
44+
/// logger.debug("Calling sum_less_than_four")
4445
/// return a + b < 4
4546
/// ```
4647
///

0 commit comments

Comments
 (0)