A code formatter like Black can handle that. It's there to enforce a single code style no matter what the contributors use, whether they are human or AI.
> By default, Black uses existing trailing commas as an indication that short lines should be left separate, as described in the style documentation. If this option is given, the magic trailing comma is ignored.
https://black.readthedocs.io/en/stable/usage_and_configurati...
It should then keep the lines intact, unless they exceed the line length. I have mine set to 120.