-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
62 lines (52 loc) · 1.48 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
load("//private:extra_options_flag.bzl", "extra_options_flag")
load("//private:path_binary_wrapper.bzl", "path_binary_wrapper")
package(default_visibility = ["//visibility:public"])
path_binary_wrapper(
name = "clang-tidy-wrapper",
binary = "clang-tidy",
)
path_binary_wrapper(
name = "clang-apply-replacements-wrapper",
binary = "clang-apply-replacements",
)
filegroup(
name = "default-config",
srcs = [".clang-tidy"],
)
label_flag(
name = "clang-tidy",
build_setting_default = ":clang-tidy-wrapper",
)
label_flag(
name = "clang-apply-replacements",
build_setting_default = ":clang-apply-replacements-wrapper",
)
label_flag(
name = "config",
build_setting_default = ":default-config",
)
# Extra options appended after `tidy_options`. This allows extra options to be
# specified on the command line (e.g. changing the checks to use with
# `clang-tidy`).
extra_options_flag(
name = "extra-options",
build_setting_default = [""],
)
# Manually applies fixes from .yaml files contained in a specified directory.
sh_binary(
name = "apply-fixes",
srcs = ["apply-fixes.bash"],
args = ["$(location :clang-apply-replacements)"],
data = [":clang-apply-replacements"],
)
# export such that files can manually be added as test dependencies
filegroup(
name = "files",
srcs = [
"apply-fixes.bash",
"apply_fixes.bzl",
"defs.bzl",
"make_clang_tidy_aspect.bzl",
],
visibility = ["//test:__pkg__"],
)