Add braces to C++ single-line loops and conditionals (NFC) (#2973)

This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
This commit is contained in:
Peter Johnson
2020-12-28 12:58:06 -08:00
committed by GitHub
parent 0291a3ff56
commit 2aed432b4b
634 changed files with 10716 additions and 3938 deletions

View File

@@ -19,8 +19,9 @@ SpeedControllerGroup::SpeedControllerGroup(
}
void SpeedControllerGroup::Initialize() {
for (auto& speedController : m_speedControllers)
for (auto& speedController : m_speedControllers) {
SendableRegistry::GetInstance().AddChild(this, &speedController.get());
}
static int instances = 0;
++instances;
SendableRegistry::GetInstance().Add(this, "SpeedControllerGroup", instances);
@@ -43,7 +44,9 @@ void SpeedControllerGroup::SetInverted(bool isInverted) {
m_isInverted = isInverted;
}
bool SpeedControllerGroup::GetInverted() const { return m_isInverted; }
bool SpeedControllerGroup::GetInverted() const {
return m_isInverted;
}
void SpeedControllerGroup::Disable() {
for (auto speedController : m_speedControllers) {
@@ -57,7 +60,9 @@ void SpeedControllerGroup::StopMotor() {
}
}
void SpeedControllerGroup::PIDWrite(double output) { Set(output); }
void SpeedControllerGroup::PIDWrite(double output) {
Set(output);
}
void SpeedControllerGroup::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Speed Controller");