style: Add braces to all control flow statements (#6887)

* style: Add braces to all control flow statements

  Standardize code style by adding explicit braces to all single-statement
  control flow blocks (if, else, for, while) across the entire codebase.

  Also documents the InsertBraces clang-format option (requires v15+) for
  future automated enforcement.

* InsertBraces-check-enabled
This commit is contained in:
DawnFire42 2026-05-16 13:19:53 -04:00 committed by GitHub
parent 7153f7d4c1
commit aadee34238
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
173 changed files with 2725 additions and 1461 deletions

View file

@ -38,8 +38,9 @@ bool AbstractDecklistCardNode::readElement(QXmlStreamReader *xml)
{
while (!xml->atEnd()) {
xml->readNext();
if (xml->isEndElement() && xml->name().toString() == "card")
if (xml->isEndElement() && xml->name().toString() == "card") {
return false;
}
}
return true;
}

View file

@ -48,8 +48,9 @@ QString InnerDecklistNode::getVisibleName() const
void InnerDecklistNode::clearTree()
{
for (int i = 0; i < size(); i++)
for (int i = 0; i < size(); i++) {
delete at(i);
}
clear();
}
@ -154,8 +155,9 @@ bool InnerDecklistNode::readElement(QXmlStreamReader *xml)
xml->attributes().value("collectorNumber").toString(), xml->attributes().value("uuid").toString());
newCard->readElement(xml);
}
} else if (xml->isEndElement() && (childName == "zone"))
} else if (xml->isEndElement() && (childName == "zone")) {
return false;
}
}
return true;
}
@ -164,8 +166,9 @@ void InnerDecklistNode::writeElement(QXmlStreamWriter *xml)
{
xml->writeStartElement("zone");
xml->writeAttribute("name", name);
for (int i = 0; i < size(); i++)
for (int i = 0; i < size(); i++) {
at(i)->writeElement(xml);
}
xml->writeEndElement(); // zone
}