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?
This commit is contained in:
Chris Bachhuber 2025-12-19 20:08:12 +01:00 committed by GitHub
parent 2151c3d351
commit b342f60b40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -37,10 +37,11 @@ use crate::{Fix, FixAvailability, Violation};
/// import logging
///
/// logging.basicConfig(level=logging.INFO)
/// logger = logging.getLogger(__name__)
///
///
/// def sum_less_than_four(a, b):
/// logging.debug("Calling sum_less_than_four")
/// logger.debug("Calling sum_less_than_four")
/// return a + b < 4
/// ```
///