4
0
Эх сурвалжийг харах

.github: Add clang-format

Signed-off-by: Dave Tucker <[email protected]>
Dave Tucker 1 жил өмнө
parent
commit
02124002c8

+ 3 - 0
.github/workflows/ci.yml

@@ -30,6 +30,9 @@ jobs:
         with:
           tool: cargo-hack,taplo-cli
 
+      - name: Check C formatting
+        run: git ls-files -- '*.c' '*.h' | xargs clang-format --dry-run --Werror
+
       - run: taplo fmt --check
 
       - name: Check formatting

+ 4 - 4
aya-obj/include/linux_wrapper.h

@@ -1,11 +1,11 @@
+#include <asm-generic/socket.h>
 #include <linux/bpf.h>
 #include <linux/btf.h>
-#include <linux/perf_event.h>
 #include <linux/if_link.h>
-#include <linux/rtnetlink.h>
-#include <asm-generic/socket.h>
-#include <linux/pkt_sched.h>
+#include <linux/perf_event.h>
 #include <linux/pkt_cls.h>
+#include <linux/pkt_sched.h>
+#include <linux/rtnetlink.h>
 
 /* workaround the fact that bindgen can't parse the IOC macros */
 int AYA_PERF_EVENT_IOC_ENABLE = PERF_EVENT_IOC_ENABLE;

+ 3 - 3
bpf/aya-bpf-bindings/include/bindings.h

@@ -3,9 +3,9 @@
 // https://elixir.bootlin.com/linux/v5.13/source/include/uapi/linux/types.h
 typedef __u32 __bitwise __wsum;
 
+#include "bpf_helpers.h"
 #include <linux/bpf.h>
-#include <linux/ptrace.h>
-#include <sys/socket.h>
 // needed for TC_ACT_*
 #include <linux/pkt_cls.h>
-#include "bpf_helpers.h"
+#include <linux/ptrace.h>
+#include <sys/socket.h>