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/y2017/control_loops/superstructure/column/column.cc b/y2017/control_loops/superstructure/column/column.cc
index 8f36085..9acd190 100644
--- a/y2017/control_loops/superstructure/column/column.cc
+++ b/y2017/control_loops/superstructure/column/column.cc
@@ -6,6 +6,7 @@
#include <utility>
#include "Eigen/Dense"
+
#include "aos/commonmath.h"
#include "frc971/constants.h"
#include "frc971/control_loops/profiled_subsystem.h"
diff --git a/y2017/control_loops/superstructure/column/column_zeroing.cc b/y2017/control_loops/superstructure/column/column_zeroing.cc
index 7d5937a..53bec5f 100644
--- a/y2017/control_loops/superstructure/column/column_zeroing.cc
+++ b/y2017/control_loops/superstructure/column/column_zeroing.cc
@@ -69,10 +69,10 @@
flatbuffers::Offset<ColumnZeroingEstimator::State>
ColumnZeroingEstimator::GetEstimatorState(
flatbuffers::FlatBufferBuilder *fbb) const {
- flatbuffers::Offset<frc971::HallEffectAndPositionEstimatorState> indexer_offset =
- indexer_.GetEstimatorState(fbb);
- flatbuffers::Offset<frc971::HallEffectAndPositionEstimatorState> turret_offset =
- turret_.GetEstimatorState(fbb);
+ flatbuffers::Offset<frc971::HallEffectAndPositionEstimatorState>
+ indexer_offset = indexer_.GetEstimatorState(fbb);
+ flatbuffers::Offset<frc971::HallEffectAndPositionEstimatorState>
+ turret_offset = turret_.GetEstimatorState(fbb);
State::Builder state_builder(*fbb);
state_builder.add_indexer(indexer_offset);
@@ -84,5 +84,5 @@
} // namespace column
} // namespace superstructure
-} // control_loops
-} // y2017
+} // namespace control_loops
+} // namespace y2017
diff --git a/y2017/control_loops/superstructure/column/column_zeroing.h b/y2017/control_loops/superstructure/column/column_zeroing.h
index 8c2cbf3..a7fe47b 100644
--- a/y2017/control_loops/superstructure/column/column_zeroing.h
+++ b/y2017/control_loops/superstructure/column/column_zeroing.h
@@ -29,9 +29,7 @@
bool offset_ready() const { return offset_ready_; }
- bool error() const {
- return error_ || indexer_.error() || turret_.error();
- }
+ bool error() const { return error_ || indexer_.error() || turret_.error(); }
bool zeroed() const {
return zeroed_ && indexer_.zeroed() && turret_.zeroed();
@@ -67,9 +65,9 @@
const double turret_zeroed_distance_;
};
-} // column
-} // superstructure
-} // control_loops
-} // y2017
+} // namespace column
+} // namespace superstructure
+} // namespace control_loops
+} // namespace y2017
#endif // y2017_CONTROL_LOOPS_SUPERSTRUCTURE_COLUMN_H_
diff --git a/y2017/control_loops/superstructure/column/column_zeroing_test.cc b/y2017/control_loops/superstructure/column/column_zeroing_test.cc
index af0eb15..ef32beb 100644
--- a/y2017/control_loops/superstructure/column/column_zeroing_test.cc
+++ b/y2017/control_loops/superstructure/column/column_zeroing_test.cc
@@ -1,17 +1,20 @@
+#include "y2017/control_loops/superstructure/column/column_zeroing.h"
+
#include <unistd.h>
+
#include <memory>
#include <random>
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/die.h"
#include "aos/flatbuffers.h"
#include "aos/json_to_flatbuffer.h"
#include "frc971/control_loops/position_sensor_sim.h"
#include "frc971/control_loops/team_number_test_environment.h"
#include "frc971/zeroing/zeroing.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
#include "y2017/constants.h"
-#include "y2017/control_loops/superstructure/column/column_zeroing.h"
namespace y2017 {
namespace control_loops {
@@ -66,8 +69,8 @@
column_position_builder.add_turret(turret_offset);
fbb.Finish(column_position_builder.Finish());
-
- aos::FlatbufferDetachedBuffer<ColumnPosition> column_position(fbb.Release());
+ aos::FlatbufferDetachedBuffer<ColumnPosition> column_position(
+ fbb.Release());
LOG(INFO) << "Position: " << aos::FlatbufferToJson(column_position);
column_zeroing_estimator_.UpdateEstimate(column_position.message());