From 0e4443f2cae12a2916a9f631976a454cfb0f7583 Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Mon, 4 May 2020 11:45:39 +0200 Subject: [PATCH] Instead disable the buildifier warning --- cc/private/toolchain/cc_configure.bzl | 18 +++++++----------- cc/repositories.bzl | 5 +++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/cc/private/toolchain/cc_configure.bzl b/cc/private/toolchain/cc_configure.bzl index fa630be..c281198 100644 --- a/cc/private/toolchain/cc_configure.bzl +++ b/cc/private/toolchain/cc_configure.bzl @@ -173,17 +173,13 @@ cc_autoconf = repository_rule( configure = True, ) -def cc_configure(name = "local_config_cc"): - """A C++ configuration rules that generate the crosstool file. - - Args: - name: name of the repository - """ - cc_autoconf_toolchains(name = name + "_toolchains") - cc_autoconf(name = name) - if name == "local_config_cc": - native.bind(name = "cc_toolchain", actual = "@local_config_cc//:toolchain") +# buildifier: disable=unnamed-macro +def cc_configure(): + """A C++ configuration rules that generate the crosstool file.""" + cc_autoconf_toolchains(name = "local_config_cc_toolchains") + cc_autoconf(name = "local_config_cc") + native.bind(name = "cc_toolchain", actual = "@local_config_cc//:toolchain") native.register_toolchains( # Use register_toolchain's target pattern expansion to register all toolchains in the package. - "@" + name + "_toolchains//:all", + "@local_config_cc_toolchains//:all", ) diff --git a/cc/repositories.bzl b/cc/repositories.bzl index f52ade2..5d0c56b 100644 --- a/cc/repositories.bzl +++ b/cc/repositories.bzl @@ -23,8 +23,9 @@ def rules_cc_dependencies(): ], ) -def rules_cc_toolchains(name = "local_config_cc", *args): - cc_configure(name, *args) +# buildifier: disable=unnamed-macro +def rules_cc_toolchains(*args): + cc_configure(*args) def _maybe(repo_rule, name, **kwargs): if not native.existing_rule(name):