Run clang-format on the entire repo

This patch clang-formats the entire repo. Third-party code is
excluded.

I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.

Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/y2022/control_loops/drivetrain/drivetrain_base.cc b/y2022/control_loops/drivetrain/drivetrain_base.cc
index f18ebf2..c58353e 100644
--- a/y2022/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2022/control_loops/drivetrain/drivetrain_base.cc
@@ -9,8 +9,8 @@
 #include "y2022/control_loops/drivetrain/kalman_drivetrain_motor_plant.h"
 #include "y2022/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
 
-using ::frc971::control_loops::drivetrain::DrivetrainConfig;
 using ::frc971::control_loops::drivetrain::DownEstimatorConfig;
+using ::frc971::control_loops::drivetrain::DrivetrainConfig;
 
 namespace chrono = ::std::chrono;
 
diff --git a/y2022/control_loops/superstructure/catapult/catapult.cc b/y2022/control_loops/superstructure/catapult/catapult.cc
index cdffecd..b0ec6fd 100644
--- a/y2022/control_loops/superstructure/catapult/catapult.cc
+++ b/y2022/control_loops/superstructure/catapult/catapult.cc
@@ -2,9 +2,10 @@
 
 #include "Eigen/Dense"
 #include "Eigen/Sparse"
+#include "glog/logging.h"
+
 #include "aos/realtime.h"
 #include "aos/time/time.h"
-#include "glog/logging.h"
 #include "osqp++.h"
 #include "osqp.h"
 #include "y2022/control_loops/superstructure/catapult/catapult_plant.h"
diff --git a/y2022/control_loops/superstructure/catapult/catapult.h b/y2022/control_loops/superstructure/catapult/catapult.h
index 12c0116..a4c82de 100644
--- a/y2022/control_loops/superstructure/catapult/catapult.h
+++ b/y2022/control_loops/superstructure/catapult/catapult.h
@@ -2,8 +2,9 @@
 #define Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_CATAPULT_CATAPULT_H_
 
 #include "Eigen/Dense"
-#include "frc971/control_loops/state_feedback_loop.h"
 #include "glog/logging.h"
+
+#include "frc971/control_loops/state_feedback_loop.h"
 #include "osqp++.h"
 #include "y2022/constants.h"
 #include "y2022/control_loops/superstructure/superstructure_goal_generated.h"
diff --git a/y2022/control_loops/superstructure/catapult/catapult_test.cc b/y2022/control_loops/superstructure/catapult/catapult_test.cc
index b37c3e0..7361bcd 100644
--- a/y2022/control_loops/superstructure/catapult/catapult_test.cc
+++ b/y2022/control_loops/superstructure/catapult/catapult_test.cc
@@ -2,6 +2,7 @@
 
 #include "glog/logging.h"
 #include "gtest/gtest.h"
+
 #include "y2022/control_loops/superstructure/catapult/catapult_plant.h"
 
 namespace y2022 {
diff --git a/y2022/control_loops/superstructure/collision_avoidance_test.cc b/y2022/control_loops/superstructure/collision_avoidance_test.cc
index 7c53be3..09d1a50 100644
--- a/y2022/control_loops/superstructure/collision_avoidance_test.cc
+++ b/y2022/control_loops/superstructure/collision_avoidance_test.cc
@@ -1,9 +1,10 @@
 #include "y2022/control_loops/superstructure/collision_avoidance.h"
 
-#include "aos/commonmath.h"
-#include "aos/flatbuffers.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
+
+#include "aos/commonmath.h"
+#include "aos/flatbuffers.h"
 #include "y2022/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2022/control_loops/superstructure/superstructure_status_generated.h"
 
diff --git a/y2022/control_loops/superstructure/led_indicator.cc b/y2022/control_loops/superstructure/led_indicator.cc
index b636250..11a46e9 100644
--- a/y2022/control_loops/superstructure/led_indicator.cc
+++ b/y2022/control_loops/superstructure/led_indicator.cc
@@ -30,7 +30,7 @@
   candle_.ConfigAllSettings(config, 0);
 
   event_loop_->AddPhasedLoop([&](int) { DecideColor(); },
-                            std::chrono::milliseconds(20));
+                             std::chrono::milliseconds(20));
 }
 
 // This method will be called once per scheduler run
diff --git a/y2022/control_loops/superstructure/led_indicator.h b/y2022/control_loops/superstructure/led_indicator.h
index 71bc73b..932481f 100644
--- a/y2022/control_loops/superstructure/led_indicator.h
+++ b/y2022/control_loops/superstructure/led_indicator.h
@@ -1,10 +1,11 @@
 #ifndef Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_LED_INDICATOR_H_
 #define Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_LED_INDICATOR_H_
 
+#include "ctre/phoenix/led/CANdle.h"
+
 #include "aos/events/event_loop.h"
 #include "aos/network/message_bridge_client_generated.h"
 #include "aos/network/message_bridge_server_generated.h"
-#include "ctre/phoenix/led/CANdle.h"
 #include "frc971/control_loops/control_loop.h"
 #include "frc971/control_loops/control_loops_generated.h"
 #include "frc971/control_loops/drivetrain/drivetrain_output_generated.h"
diff --git a/y2022/control_loops/superstructure/superstructure_lib_test.cc b/y2022/control_loops/superstructure/superstructure_lib_test.cc
index 7e2acab..c85d5d0 100644
--- a/y2022/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2022/control_loops/superstructure/superstructure_lib_test.cc
@@ -1,19 +1,20 @@
 #include <chrono>
 #include <memory>
 
+#include "gtest/gtest.h"
+
 #include "aos/events/logging/log_writer.h"
 #include "frc971/control_loops/capped_test_plant.h"
 #include "frc971/control_loops/control_loop_test.h"
 #include "frc971/control_loops/position_sensor_sim.h"
+#include "frc971/control_loops/subsystem_simulator.h"
 #include "frc971/control_loops/team_number_test_environment.h"
-#include "gtest/gtest.h"
 #include "y2022/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
 #include "y2022/control_loops/superstructure/catapult/catapult_plant.h"
 #include "y2022/control_loops/superstructure/climber/climber_plant.h"
 #include "y2022/control_loops/superstructure/intake/intake_plant.h"
 #include "y2022/control_loops/superstructure/superstructure.h"
 #include "y2022/control_loops/superstructure/turret/turret_plant.h"
-#include "frc971/control_loops/subsystem_simulator.h"
 
 DEFINE_string(output_folder, "",
               "If set, logs all channels to the provided logfile.");
@@ -35,10 +36,11 @@
     PotAndAbsoluteEncoderSubsystem;
 typedef Superstructure::RelativeEncoderSubsystem RelativeEncoderSubsystem;
 using DrivetrainStatus = ::frc971::control_loops::drivetrain::Status;
-using PotAndAbsoluteEncoderSimulator = frc971::control_loops::SubsystemSimulator<
-    frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus,
-    PotAndAbsoluteEncoderSubsystem::State,
-    constants::Values::PotAndAbsEncoderConstants>;
+using PotAndAbsoluteEncoderSimulator =
+    frc971::control_loops::SubsystemSimulator<
+        frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus,
+        PotAndAbsoluteEncoderSubsystem::State,
+        constants::Values::PotAndAbsEncoderConstants>;
 using RelativeEncoderSimulator = frc971::control_loops::SubsystemSimulator<
     frc971::control_loops::RelativeEncoderProfiledJointStatus,
     RelativeEncoderSubsystem::State, constants::Values::PotConstants>;
diff --git a/y2022/control_loops/superstructure/superstructure_replay.cc b/y2022/control_loops/superstructure/superstructure_replay.cc
index b05cdb9..d7f03e6 100644
--- a/y2022/control_loops/superstructure/superstructure_replay.cc
+++ b/y2022/control_loops/superstructure/superstructure_replay.cc
@@ -1,8 +1,10 @@
-// This binary allows us to replay the superstructure code over existing logfile.
-// When you run this code, it generates a new logfile with the data all
+// This binary allows us to replay the superstructure code over existing
+// logfile. When you run this code, it generates a new logfile with the data all
 // replayed, so that it can then be run through the plotting tool or analyzed
 // in some other way. The original superstructure status data will be on the
 // /original/superstructure channel.
+#include "gflags/gflags.h"
+
 #include "aos/events/logging/log_reader.h"
 #include "aos/events/logging/log_writer.h"
 #include "aos/events/simulated_event_loop.h"
@@ -10,7 +12,6 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/logging/log_message_generated.h"
 #include "aos/network/team_number.h"
-#include "gflags/gflags.h"
 #include "y2022/constants.h"
 #include "y2022/control_loops/superstructure/superstructure.h"