Skip to content

Commit 196a099

Browse files
keitherenon
authored andcommitted
remove skylib dep
1 parent 2057d4e commit 196a099

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang_tidy/clang_tidy_test.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""A test rule to run clang-tidy"""
22

3-
load("@bazel_skylib//lib:shell.bzl", "shell")
43
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
54
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
65
load(":clang_tidy.bzl", "deps_flags", "is_c_translation_unit", "rule_sources", "safe_flags", "toolchain_flags")
76

7+
def _quote(s):
8+
# Copied from https://github.com/bazelbuild/bazel-skylib/blob/main/lib/shell.bzl
9+
return "'" + s.replace("'", "'\\''") + "'"
10+
811
# Tests run with a different directory structure than normal compiles. This
912
# fixes up include paths or any other arguments that are sensitive to this
1013
def _fix_argument_path(ctx, arg):
@@ -77,8 +80,8 @@ fi
7780
output = ctx.outputs.executable.path,
7881
c_sources = " ".join([x.short_path for x in srcs if is_c_translation_unit(x, ctx.attr.tags)]),
7982
cxx_sources = " ".join([x.short_path for x in srcs if not is_c_translation_unit(x, ctx.attr.tags)]),
80-
c_flags = " ".join([shell.quote(_fix_argument_path(ctx, x)) for x in ccinfo_copts + c_flags]),
81-
cxx_flags = " ".join([shell.quote(_fix_argument_path(ctx, x)) for x in ccinfo_copts + cxx_flags]),
83+
c_flags = " ".join([_quote(_fix_argument_path(ctx, x)) for x in ccinfo_copts + c_flags]),
84+
cxx_flags = " ".join([_quote(_fix_argument_path(ctx, x)) for x in ccinfo_copts + cxx_flags]),
8285
),
8386
)
8487

0 commit comments

Comments
 (0)