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/motors/math_test.cc b/motors/math_test.cc
index 91100e8..fb72454 100644
--- a/motors/math_test.cc
+++ b/motors/math_test.cc
@@ -1,7 +1,7 @@
#include "motors/math.h"
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
namespace frc971 {
namespace motors {
@@ -9,20 +9,18 @@
class SinCosIntTest : public ::testing::Test {
public:
- void SetUp() override {
- MathInit();
- }
+ void SetUp() override { MathInit(); }
template <class Rotation, int kTableSize>
void CheckSinCos() {
static constexpr float kTolerance = 0.004;
- SCOPED_TRACE("num=" + ::std::to_string(Rotation::num) + " den=" +
- ::std::to_string(Rotation::den) + " table_size=" +
- ::std::to_string(kTableSize));
+ SCOPED_TRACE("num=" + ::std::to_string(Rotation::num) +
+ " den=" + ::std::to_string(Rotation::den) +
+ " table_size=" + ::std::to_string(kTableSize));
for (uint32_t theta = 0; theta < Rotation::den; ++theta) {
const float theta_float = ThetaToFloat<Rotation>(theta);
- SCOPED_TRACE("theta=" + ::std::to_string(theta) + " theta_float=" +
- ::std::to_string(theta_float));
+ SCOPED_TRACE("theta=" + ::std::to_string(theta) +
+ " theta_float=" + ::std::to_string(theta_float));
EXPECT_THAT((FastSinInt<Rotation, kTableSize>(theta)),
::testing::FloatNear(sin(theta_float), kTolerance));
EXPECT_THAT((FastCosInt<Rotation, kTableSize>(theta)),
@@ -77,9 +75,7 @@
class SinCosFloatTest : public ::testing::Test {
public:
- void SetUp() override {
- MathInit();
- }
+ void SetUp() override { MathInit(); }
void CheckSinCos(float theta) {
ASSERT_GE(theta, -0.2f);