add .clang-format

Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/main.cpp b/main.cpp
index 75b55fd..91e555f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,40 +14,33 @@
  * limitations under the License.
  */
 
-#include <chrono>
-#include <experimental/any>
-#include <getopt.h>
-#include <iostream>
-#include <map>
-#include <memory>
-#include <mutex> /* not yet used. */
-#include <thread>
-#include <unordered_map>
-#include <vector>
-
-#include <sdbusplus/bus.hpp>
-
-/* Configuration. */
-#include "conf.hpp"
 #include "config.h"
-#include <dbus/dbusconfiguration.hpp>
 
-/* Misc. */
-#include "util.hpp"
-
-/* Controllers & Sensors. */
+#include "conf.hpp"
+#include "dbus/dbusconfiguration.hpp"
 #include "interfaces.hpp"
 #include "pid/builder.hpp"
 #include "pid/builderconfig.hpp"
+#include "pid/pidthread.hpp"
 #include "pid/zone.hpp"
 #include "sensors/builder.hpp"
 #include "sensors/builderconfig.hpp"
 #include "sensors/manager.hpp"
-
-/* Threads. */
-#include "pid/pidthread.hpp"
 #include "threads/busthread.hpp"
+#include "util.hpp"
 
+#include <getopt.h>
+
+#include <chrono>
+#include <experimental/any>
+#include <iostream>
+#include <map>
+#include <memory>
+#include <mutex> /* not yet used. */
+#include <sdbusplus/bus.hpp>
+#include <thread>
+#include <unordered_map>
+#include <vector>
 
 /* The YAML converted sensor list. */
 extern std::map<std::string, struct sensor> SensorConfig;
@@ -64,11 +57,12 @@
 
     while (1)
     {
-        static struct option long_options[] =
-        {
+        // clang-format off
+        static struct option long_options[] = {
             {"conf", required_argument, 0, 'c'},
             {0, 0, 0, 0}
         };
+        // clang-format on
 
         int option_index = 0;
         c = getopt_long(argc, argv, "c:", long_options, &option_index);
@@ -81,7 +75,7 @@
         switch (c)
         {
             case 'c':
-                configPath = std::string {optarg};
+                configPath = std::string{optarg};
                 break;
             default:
                 /* skip garbage. */
@@ -141,28 +135,16 @@
     std::cerr << "Starting threads\n";
 
     /* TODO(venture): Ask SensorManager if we have any passive sensors. */
-    struct ThreadParams p =
-    {
-        std::ref(PassiveListeningBus),
-        ""
-    };
+    struct ThreadParams p = {std::ref(PassiveListeningBus), ""};
     std::thread l(BusThread, std::ref(p));
 
     /* TODO(venture): Ask SensorManager if we have any host sensors. */
     static constexpr auto hostBus = "xyz.openbmc_project.Hwmon.external";
-    struct ThreadParams e =
-    {
-        std::ref(HostSensorBus),
-        hostBus
-    };
+    struct ThreadParams e = {std::ref(HostSensorBus), hostBus};
     std::thread te(BusThread, std::ref(e));
 
     static constexpr auto modeBus = "xyz.openbmc_project.State.FanCtrl";
-    struct ThreadParams m =
-    {
-        std::ref(ModeControlBus),
-        modeBus
-    };
+    struct ThreadParams m = {std::ref(ModeControlBus), modeBus};
     std::thread tm(BusThread, std::ref(m));
 
     std::vector<std::thread> zoneThreads;
@@ -189,4 +171,3 @@
 
     return rc;
 }
-