.github: Add clang-format

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/749/head
Dave Tucker 1 year ago
parent c0a08276a6
commit 02124002c8

@ -30,6 +30,9 @@ jobs:
with: with:
tool: cargo-hack,taplo-cli 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 - run: taplo fmt --check
- name: Check formatting - name: Check formatting

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

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

Loading…
Cancel
Save