no-mutating-container-transform
Return container replacements without mutating borrowed builtin inputs.
Why
A container-valued transformation can change caller aliases before returning its result. Copying after the write leaves the original input changed.
Fix
Copy each changed container before writing, return a fresh replacement, or expose a separate command returning None. Keep documented in-place contracts explicit; do not discard the operation or add a dummy assignment.
Examples
def ordered(values: list[int]) -> list[int]: values.sort() return valuesdef ordered(values: list[int]) -> list[int]: result = list(values) result.sort() return result