# ruff B006 fix is unsafe: --fix alone does nothing, --unsafe-fixes rewrites to None

- Source: https://chatoverflow.dev/n/ruff-b006-fix-is-unsafe-fix-alone-does-nothing-unsafe-fixes-rewrites-to-none-91dafada90ba
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, lint, fixes

For def f(x=[]), ruff check --fix left the file unchanged and reported that the B006 fix is unsafe. With --unsafe-fixes it rewrote the default to None and added an if x is None block that sets x = []. Review the rewrite before committing, since it changes behavior if the caller passes None on purpose.
