tasks/system_probe.py
def clang_tidy(ctx, fix=False, fail_on_issue=False):
    """
    Lint C code using clang-tidy
    """

    print("checking for clang-tidy executable...")
    ctx.run("which clang-tidy")

    build_flags = get_ebpf_build_flags()
    build_flags.append("-DDEBUG=1")

    bpf_dir = os.path.join(".", "pkg", "ebpf")
    base_files = glob.glob(bpf_dir + "/c/**/*.c")

    network_bpf_dir = os.path.join(".", "pkg", "network", "ebpf")
    network_c_dir = os.path.join(network_bpf_dir, "c")
    network_files = list(base_files)
    network_files.extend(glob.glob(network_c_dir + "/**/*.c"))
    network_flags = list(build_flags)
    network_flags.append(f"-I{network_c_dir}")
    network_flags.append(f"-I{os.path.join(network_c_dir, 'prebuilt')}")
    network_flags.append(f"-I{os.path.join(network_c_dir, 'runtime')}")
    run_tidy(ctx, files=network_files, build_flags=network_flags, fix=fix, fail_on_issue=fail_on_issue)

    security_agent_c_dir = os.path.join(".", "pkg", "security", "ebpf", "c")
    security_files = list(base_files)
    security_files.extend(glob.glob(security_agent_c_dir + "/**/*.c"))
    security_flags = list(build_flags)
    security_flags.append(f"-I{security_agent_c_dir}")
    security_flags.append("-DUSE_SYSCALL_WRAPPER=0")
    run_tidy(ctx, files=security_files, build_flags=security_flags, fix=fix, fail_on_issue=fail_on_issue)

    Lint C code using clang-tidy
    
Lint C code using clang-tidy
Lint C code using clang - tidy
def clang_tidy(ctx, fix=False, fail_on_issue=False):
    print("checking for clang-tidy executable...")
    ctx.run("which clang-tidy")
    build_flags = get_ebpf_build_flags()
    build_flags.append("-DDEBUG=1")
    bpf_dir = os.path.join(".", "pkg", "ebpf")
    base_files = glob.glob(bpf_dir + "/c/**/*.c")
    network_bpf_dir = os.path.join(".", "pkg", "network", "ebpf")
    network_c_dir = os.path.join(network_bpf_dir, "c")
    network_files = list(base_files)
    network_files.extend(glob.glob(network_c_dir + "/**/*.c"))
    network_flags = list(build_flags)
    network_flags.append(f"-I{network_c_dir}")
    network_flags.append(f"-I{os.path.join(network_c_dir, 'prebuilt')}")
    network_flags.append(f"-I{os.path.join(network_c_dir, 'runtime')}")
    run_tidy(ctx, files=network_files, build_flags=network_flags, fix=fix, fail_on_issue=fail_on_issue)
    security_agent_c_dir = os.path.join(".", "pkg", "security", "ebpf", "c")
    security_files = list(base_files)
    security_files.extend(glob.glob(security_agent_c_dir + "/**/*.c"))
    security_flags = list(build_flags)
    security_flags.append(f"-I{security_agent_c_dir}")
    security_flags.append("-DUSE_SYSCALL_WRAPPER=0")
    run_tidy(ctx, files=security_files, build_flags=security_flags, fix=fix, fail_on_issue=fail_on_issue)
def clang_tidy ( ctx , fix = False , fail_on_issue = False ) : print ( "checking for clang-tidy executable..." ) ctx . run ( "which clang-tidy" ) build_flags = get_ebpf_build_flags ( ) build_flags . append ( "-DDEBUG=1" ) bpf_dir = os . path . join ( "." , "pkg" , "ebpf" ) base_files = glob . glob ( bpf_dir + "/c/**/*.c" ) network_bpf_dir = os . path . join ( "." , "pkg" , "network" , "ebpf" ) network_c_dir = os . path . join ( network_bpf_dir , "c" ) network_files = list ( base_files ) network_files . extend ( glob . glob ( network_c_dir + "/**/*.c" ) ) network_flags = list ( build_flags ) network_flags . append ( f"-I{network_c_dir}" ) network_flags . append ( f"-I{os.path.join(network_c_dir, 'prebuilt')}" ) network_flags . append ( f"-I{os.path.join(network_c_dir, 'runtime')}" ) run_tidy ( ctx , files = network_files , build_flags = network_flags , fix = fix , fail_on_issue = fail_on_issue ) security_agent_c_dir = os . path . join ( "." , "pkg" , "security" , "ebpf" , "c" ) security_files = list ( base_files ) security_files . extend ( glob . glob ( security_agent_c_dir + "/**/*.c" ) ) security_flags = list ( build_flags ) security_flags . append ( f"-I{security_agent_c_dir}" ) security_flags . append ( "-DUSE_SYSCALL_WRAPPER=0" ) run_tidy ( ctx , files = security_files , build_flags = security_flags , fix = fix , fail_on_issue = fail_on_issue )
Lint C code using clang-tidy
Lint C code using clang - tidy
"""
    Lint C code using clang-tidy
    """
ctx
fix
fail_on_issue