Interlocked buttons with clear troubleshooting

In contrast to you I use Auto Format frequently when writing code and most certainly on code copied from the forum and I have it configured to suit me

For instance, when presented with

if (buttonState2 == HIGH) {
        ledState3 = !ledState3;
      } while (1);

my Auto Format turns it into

  if (buttonState2 == HIGH)
  {
    ledState3 = !ledState3;
  }
  while (1);

but that is just a matter of taste