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

@@ -28,11 +28,17 @@ Servo::Servo(int channel) : PWM(channel) {
SendableRegistry::GetInstance().SetName(this, "Servo", channel);
}
void Servo::Set(double value) { SetPosition(value); }
void Servo::Set(double value) {
SetPosition(value);
}
void Servo::SetOffline() { SetRaw(0); }
void Servo::SetOffline() {
SetRaw(0);
}
double Servo::Get() const { return GetPosition(); }
double Servo::Get() const {
return GetPosition();
}
void Servo::SetAngle(double degrees) {
if (degrees < kMinServoAngle) {
@@ -48,9 +54,13 @@ double Servo::GetAngle() const {
return GetPosition() * GetServoAngleRange() + kMinServoAngle;
}
double Servo::GetMaxAngle() const { return kMaxServoAngle; }
double Servo::GetMaxAngle() const {
return kMaxServoAngle;
}
double Servo::GetMinAngle() const { return kMinServoAngle; }
double Servo::GetMinAngle() const {
return kMinServoAngle;
}
void Servo::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Servo");