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/frc971/constants/constants_sender_example.cc b/frc971/constants/constants_sender_example.cc
index 6f9ba01..a0b23ce 100644
--- a/frc971/constants/constants_sender_example.cc
+++ b/frc971/constants/constants_sender_example.cc
@@ -1,12 +1,13 @@
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "constants_sender_lib.h"
+#include "frc971/constants/constants_sender_lib.h"
#include "frc971/constants/testdata/constants_data_generated.h"
#include "frc971/constants/testdata/constants_list_generated.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(config, "frc971/constants/testdata/aos_config.json",
"Path to the config.");
diff --git a/frc971/constants/constants_sender_lib.h b/frc971/constants/constants_sender_lib.h
index 48cacb5..9bd2c00 100644
--- a/frc971/constants/constants_sender_lib.h
+++ b/frc971/constants/constants_sender_lib.h
@@ -1,13 +1,14 @@
#ifndef FRC971_CONSTANTS_CONSTANTS_SENDER_H_
#define FRC971_CONSTANTS_CONSTANTS_SENDER_H_
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/shm_event_loop.h"
#include "aos/flatbuffer_merge.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/network/team_number.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
namespace frc971::constants {
@@ -81,9 +82,7 @@
});
}
- const ConstantsData& constants() const {
- return *fetcher_.get();
- }
+ const ConstantsData &constants() const { return *fetcher_.get(); }
private:
aos::Fetcher<ConstantsData> fetcher_;
diff --git a/frc971/constants/constants_sender_test.cc b/frc971/constants/constants_sender_test.cc
index 512cb68..5e551c1 100644
--- a/frc971/constants/constants_sender_test.cc
+++ b/frc971/constants/constants_sender_test.cc
@@ -1,3 +1,6 @@
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/configuration.h"
#include "aos/events/event_loop.h"
#include "aos/events/simulated_event_loop.h"
@@ -7,8 +10,6 @@
#include "frc971/constants/constants_sender_lib.h"
#include "frc971/constants/testdata/constants_data_generated.h"
#include "frc971/constants/testdata/constants_list_generated.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace frc971::constants {
namespace testing {
@@ -84,10 +85,10 @@
constants_sender_event_loop_->MakeSender<testdata::ConstantsData>(
"/constants");
constants_sender_event_loop_->OnRun([&sender]() {
- auto builder = sender.MakeBuilder();
- builder.CheckOk(builder.Send(
- builder.MakeBuilder<testdata::ConstantsData>().Finish()));
- });
+ auto builder = sender.MakeBuilder();
+ builder.CheckOk(
+ builder.Send(builder.MakeBuilder<testdata::ConstantsData>().Finish()));
+ });
EXPECT_DEATH(event_loop_factory_.RunFor(std::chrono::seconds(1)),
"changes to constants");
}