diff --git a/libmapper/.clang-format b/libmapper/.clang-format
deleted file mode 100644
index 4662692..0000000
--- a/libmapper/.clang-format
+++ /dev/null
@@ -1,2 +0,0 @@
----
-DisableFormat: true
diff --git a/libmapper/app.c b/libmapper/app.c
index b8639f8..485a507 100644
--- a/libmapper/app.c
+++ b/libmapper/app.c
@@ -13,6 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include "mapper.h"
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -20,8 +22,6 @@
 #include <systemd/sd-event.h>
 #include <unistd.h>
 
-#include "mapper.h"
-
 static void quit(int r, void* loop)
 {
     sd_event_exit((sd_event*)loop, r);
@@ -253,11 +253,19 @@
     }
 
     if (!strcmp(argv[1], "wait"))
+    {
         wait_main(argc, argv);
+    }
+
     if (!strcmp(argv[1], "subtree-remove"))
+    {
         subtree_main(argc, argv);
+    }
+
     if (!strcmp(argv[1], "get-service"))
+    {
         get_service_main(argc, argv);
+    }
 
     fprintf(stderr, usage, argv[0]);
     exit(EXIT_FAILURE);
diff --git a/libmapper/internal.h b/libmapper/internal.h
index 836a5ec..1e9ded9 100644
--- a/libmapper/internal.h
+++ b/libmapper/internal.h
@@ -1,7 +1,8 @@
 #pragma once
 #include <stddef.h>
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 size_t sarraylen(char* array[]);
 void sarrayfree(char* array[]);
diff --git a/libmapper/mapper.c b/libmapper/mapper.c
index 4a38790..28ad314 100644
--- a/libmapper/mapper.c
+++ b/libmapper/mapper.c
@@ -15,6 +15,8 @@
  */
 #include "mapper.h"
 
+#include "internal.h"
+
 #include <errno.h>
 #include <stdbool.h>
 #include <stddef.h>
@@ -26,8 +28,6 @@
 #include <systemd/sd-event.h>
 #include <unistd.h>
 
-#include "internal.h"
-
 #define _public_ __attribute__((__visibility__("default")))
 #define _unused_ __attribute__((unused))
 
@@ -134,13 +134,17 @@
 
     ret = calloc(count + 1, sizeof(*ret));
     if (!ret)
+    {
         return NULL;
+    }
 
     for (i = 0; i < count; ++i)
     {
         ret[i] = strdup(array[i]);
         if (!ret[i])
+        {
             goto error;
+        }
     }
 
     return ret;
@@ -182,11 +186,15 @@
     uint64_t next_retry;
 
     if (wait->finished)
+    {
         goto exit;
+    }
 
     if (sd_bus_message_is_method_error(
             m, "xyz.openbmc_project.Common.Error.ResourceNotFound"))
+    {
         goto exit;
+    }
 
     r = sd_bus_message_get_errno(m);
 
@@ -227,7 +235,9 @@
     }
 
     if (async_wait_check_done(wait))
+    {
         async_wait_done(0, wait);
+    }
 
 exit:
     free(data);
@@ -243,7 +253,9 @@
     for (i = 0; i < wait->count; ++i)
     {
         if (wait->status[i])
+        {
             continue;
+        }
         data = malloc(sizeof(*data));
         data->wait = wait;
         data->path = wait->objs[i];
@@ -265,19 +277,22 @@
     return 0;
 }
 
-static int async_wait_match_introspection_complete(_unused_ sd_bus_message* m,
-                                                   void* w,
-                                                   _unused_ sd_bus_error* e)
+static int async_wait_match_introspection_complete(
+    _unused_ sd_bus_message* m, void* w, _unused_ sd_bus_error* e)
 {
     int r;
 
     mapper_async_wait* wait = w;
     if (wait->finished)
+    {
         return 0;
+    }
 
     r = async_wait_get_objects(wait);
     if (r < 0)
+    {
         async_wait_done(r, wait);
+    }
 
     return 0;
 }
@@ -285,14 +300,18 @@
 static void async_wait_done(int r, mapper_async_wait* w)
 {
     if (w->finished)
+    {
         return;
+    }
 
     w->finished = 1;
     sd_bus_slot_unref(w->introspection_slot);
     sd_bus_slot_unref(w->intf_slot);
 
     if (w->callback)
+    {
         w->callback(r, w->userdata);
+    }
 }
 
 static int async_wait_check_done(mapper_async_wait* w)
@@ -300,11 +319,17 @@
     size_t i;
 
     if (w->finished)
+    {
         return 1;
+    }
 
     for (i = 0; i < w->count; ++i)
+    {
         if (!w->status[i])
+        {
             return 0;
+        }
+    }
 
     return 1;
 }
@@ -325,7 +350,9 @@
 
     wait = malloc(sizeof(*wait));
     if (!wait)
+    {
         return -ENOMEM;
+    }
 
     memset(wait, 0, sizeof(*wait));
     wait->conn = conn;
@@ -397,9 +424,8 @@
     return r;
 }
 
-static int async_subtree_timeout_callback(_unused_ sd_event_source* s,
-                                          _unused_ uint64_t usec,
-                                          void* userdata)
+static int async_subtree_timeout_callback(
+    _unused_ sd_event_source* s, _unused_ uint64_t usec, void* userdata)
 {
     int r;
     struct mapper_async_subtree* subtree = userdata;
@@ -412,7 +438,9 @@
         async_subtree_getpaths_callback, subtree, "sias", subtree->namespace, 0,
         1, subtree->interface);
     if (r < 0)
+    {
         async_subtree_done(r, subtree);
+    }
 
     return 0;
 }
@@ -425,7 +453,9 @@
     uint64_t next_retry;
 
     if (subtree->finished)
+    {
         goto exit;
+    }
 
     r = sd_bus_message_get_errno(m);
 
@@ -433,9 +463,13 @@
             m, "xyz.openbmc_project.Common.Error.ResourceNotFound"))
     {
         if (subtree->op == MAPPER_OP_REMOVE)
+        {
             r = 0;
+        }
         else
+        {
             goto exit;
+        }
     }
 
     if ((r == EBUSY || r == ENOBUFS) && subtree->retry < mapper_busy_retries)
@@ -522,11 +556,15 @@
 
     mapper_async_subtree* subtree = t;
     if (subtree->finished)
+    {
         return 0;
+    }
 
     r = async_subtree_getpaths(subtree);
     if (r < 0)
+    {
         async_subtree_done(r, subtree);
+    }
 
     return 0;
 }
@@ -534,13 +572,17 @@
 static void async_subtree_done(int r, mapper_async_subtree* t)
 {
     if (t->finished)
+    {
         return;
+    }
 
     t->finished = 1;
     sd_bus_slot_unref(t->slot);
 
     if (t->callback)
+    {
         t->callback(r, t->userdata);
+    }
 }
 
 _public_ int mapper_subtree_async(sd_bus* conn, sd_event* loop, char* namespace,
@@ -553,7 +595,9 @@
 
     subtree = malloc(sizeof(*subtree));
     if (!subtree)
+    {
         return -ENOMEM;
+    }
 
     memset(subtree, 0, sizeof(*subtree));
     subtree->conn = conn;
@@ -611,14 +655,20 @@
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetObject");
     if (r < 0)
+    {
         goto exit;
+    }
 
     r = sd_bus_message_append(request, "s", obj);
     if (r < 0)
+    {
         goto exit;
+    }
     r = sd_bus_message_append(request, "as", 0, NULL);
     if (r < 0)
+    {
         goto exit;
+    }
 
     while (true)
     {
@@ -636,7 +686,9 @@
     }
 
     if (r < 0)
+    {
         goto exit;
+    }
 
 exit:
     sd_bus_message_unref(request);
@@ -652,19 +704,27 @@
 
     r = mapper_get_object(conn, obj, &reply);
     if (r < 0)
+    {
         goto exit;
+    }
 
     r = sd_bus_message_enter_container(reply, 0, NULL);
     if (r < 0)
+    {
         goto exit;
+    }
 
     r = sd_bus_message_enter_container(reply, 0, NULL);
     if (r < 0)
+    {
         goto exit;
+    }
 
     r = sd_bus_message_read(reply, "s", &tmp);
     if (r < 0)
+    {
         goto exit;
+    }
 
     *service = strdup(tmp);
 
diff --git a/libmapper/mapper.h b/libmapper/mapper.h
index 3f86fa6..b3c1284 100644
--- a/libmapper/mapper.h
+++ b/libmapper/mapper.h
@@ -3,7 +3,8 @@
 #include <systemd/sd-event.h>
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 typedef enum mapper_operation
 {
diff --git a/libmapper/test/utils.c b/libmapper/test/utils.c
index b3c7ae1..67f3eab 100644
--- a/libmapper/test/utils.c
+++ b/libmapper/test/utils.c
@@ -9,13 +9,17 @@
     size_t i;
     char** ret = calloc(len + 1, sizeof(*ret));
     if (!ret)
+    {
         return NULL;
+    }
 
     for (i = 0; i < len; ++i)
     {
         ret[i] = strdup(testString);
         if (!ret[i])
+        {
             goto error;
+        }
     }
 
     return ret;
diff --git a/libmapper/test/utils.h b/libmapper/test/utils.h
index 73162cb..61bd35b 100644
--- a/libmapper/test/utils.h
+++ b/libmapper/test/utils.h
@@ -1,7 +1,8 @@
 #pragma once
 #include <stddef.h>
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 char** generate_test_sarray(size_t);
 #ifdef __cplusplus
