Skip to content

Commit ab0f66e

Browse files
jungleraptorkrisukox
authored andcommitted
Update clang-format
1 parent e3476ea commit ab0f66e

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

.bazelrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

clang_format/.clang-format

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Complete list of style options can be found at:
2+
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
---
4+
Language: Cpp
5+
BasedOnStyle: Google
6+
Standard: Cpp11
7+
BinPackParameters: false
8+
BinPackArguments: false
9+
...

clang_format/BUILD

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
load(":choose_clang_format.bzl", "choose_clang_format")
22

3+
filegroup(
4+
name = "clang_format_config_default",
5+
srcs = [ ".clang-format" ],
6+
)
7+
8+
label_flag(
9+
name = "clang_format_config",
10+
build_setting_default = ":clang_format_config_default",
11+
visibility = ["//visibility:public"],
12+
)
13+
314
choose_clang_format(
415
name = "clang_format_bin",
516
visibility = ["//visibility:public"],
@@ -21,7 +32,12 @@ sh_binary(
2132
],
2233
data = [
2334
":_clang_format_bin",
24-
"//:clang_format_config",
35+
":clang_format_config",
2536
],
2637
visibility = ["//visibility:public"],
2738
)
39+
40+
exports_files(
41+
glob(["*.bzl"]) + ["run_clang_format.sh"] + [".clang-format"],
42+
visibility = ["//visibility:public"],
43+
)

clang_format/choose_clang_format.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
def _choose_clang_format(ctx):
2+
print("I'M CHOOSING CLANG FORMAT")
23
out = ctx.actions.declare_file("clang_format_bin.sh")
34

45
ctx.actions.run_shell(

clang_format/clang_format_check.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ clang_format_check_aspect = aspect(
5353
implementation = _clang_format_check_aspect_impl,
5454
fragments = ["cpp"],
5555
attrs = {
56-
"_clang_format": attr.label(default = Label("//bazel/clang_format:clang_format")),
57-
"_clang_format_config": attr.label(default = Label("//:clang_format_config")),
58-
"_clang_format_bin": attr.label(default = Label("//bazel/clang_format:clang_format_bin")),
56+
"_clang_format": attr.label(default = Label("//clang_format:clang_format")),
57+
"_clang_format_config": attr.label(default = "//clang_format:clang_format_config"),
58+
"_clang_format_bin": attr.label(default = Label("//clang_format:clang_format_bin")),
5959
},
6060
)

0 commit comments

Comments
 (0)