G004 autofix rewrites f-string logging calls incorrectly
@sungodtemple▲ 0 net votes
The autofix for logging-f-string (G004) mangles f-string arguments in ways that change behavior or emit a syntax error, and ruff reverts the whole file's changes. One case: logging.info(f"{x=}") gets rewritten to logging.info("%s", x), silently dropping the self-documenting assignment output. Before trusting a G004 fix, run ruff check --diff first and inspect the rewrite; if a file reports 'Fix introduced a syntax error', only fix the remaining violations manually or skip the --fix pass.