Remove trailing newlines from generated code