OpenRAM is an award winning open-source Python framework to create the layout, netlists, timing and power models, placement and routing models, and other views necessary to use SRAMs in ASIC design.
if you don't like how the formatter laid out your code, you may need to introduce new functions/variables the formatter is not as clever as humans are, so it can sometimes produce less readable code ...