From d1b41b82c70d2bec64152e31beafa7b5bdc32737 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Thu, 25 Apr 2024 12:36:55 +0200 Subject: [PATCH] Reformat with latest buildifier --- def.bzl | 12 ++++++------ docs/BUILD.bazel | 2 +- internal/bzlmod/go_deps.bzl | 2 +- internal/bzlmod/non_module_deps.bzl | 16 +++++++-------- internal/extend_docs.bzl | 2 +- internal/go_repository.bzl | 30 ++++++++++++++--------------- tests/bcr/go_mod/proto/BUILD.bazel | 2 +- tests/bcr/go_work/proto/BUILD.bazel | 2 +- tests/cli/env_variables_test.bzl | 2 +- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/def.bzl b/def.bzl index f348273ee..afba7e429 100644 --- a/def.bzl +++ b/def.bzl @@ -12,13 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +load( + "@bazel_gazelle_is_bazel_module//:defs.bzl", + "GAZELLE_IS_BAZEL_MODULE", +) load( "@bazel_skylib//lib:shell.bzl", "shell", ) load( - "@bazel_gazelle_is_bazel_module//:defs.bzl", - "GAZELLE_IS_BAZEL_MODULE", + "//internal:gazelle_binary.bzl", + _gazelle_binary = "gazelle_binary_wrapper", ) load( "//internal:go_repository.bzl", @@ -29,10 +33,6 @@ load( _git_repository = "git_repository", _http_archive = "http_archive", ) -load( - "//internal:gazelle_binary.bzl", - _gazelle_binary = "gazelle_binary_wrapper", -) load( "//internal/generationtest:generationtest.bzl", _gazelle_generation_test = "gazelle_generation_test", diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index a9937108b..6ce4ede3f 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -5,8 +5,8 @@ resulting documentation markdown files, to prevent users trying to load() the stardoc repository, which is not a dependency users should install. """ -load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@bazel_skylib//rules:diff_test.bzl", "diff_test") +load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc") # gazelle:ignore diff --git a/internal/bzlmod/go_deps.bzl b/internal/bzlmod/go_deps.bzl index 8a61d59b1..bdbda4519 100644 --- a/internal/bzlmod/go_deps.bzl +++ b/internal/bzlmod/go_deps.bzl @@ -13,13 +13,13 @@ # limitations under the License. load("//internal:go_repository.bzl", "go_repository") -load(":go_mod.bzl", "deps_from_go_mod", "parse_go_work", "sums_from_go_mod", "sums_from_go_work") load( ":default_gazelle_overrides.bzl", "DEFAULT_BUILD_EXTRA_ARGS_BY_PATH", "DEFAULT_BUILD_FILE_GENERATION_BY_PATH", "DEFAULT_DIRECTIVES_BY_PATH", ) +load(":go_mod.bzl", "deps_from_go_mod", "parse_go_work", "sums_from_go_mod", "sums_from_go_work") load(":semver.bzl", "semver") load( ":utils.bzl", diff --git a/internal/bzlmod/non_module_deps.bzl b/internal/bzlmod/non_module_deps.bzl index 1a97eb7ec..d7572c263 100644 --- a/internal/bzlmod/non_module_deps.bzl +++ b/internal/bzlmod/non_module_deps.bzl @@ -12,6 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +load( + "@bazel_gazelle_go_repository_config//:go_env.bzl", + "GO_ENV", +) +load( + "@go_host_compatible_sdk_label//:defs.bzl", + "HOST_COMPATIBLE_SDK", +) load( "//internal:go_repository_cache.bzl", "go_repository_cache", @@ -28,14 +36,6 @@ load( "//internal/bzlmod:utils.bzl", "extension_metadata", ) -load( - "@go_host_compatible_sdk_label//:defs.bzl", - "HOST_COMPATIBLE_SDK", -) -load( - "@bazel_gazelle_go_repository_config//:go_env.bzl", - "GO_ENV", -) visibility("//") diff --git a/internal/extend_docs.bzl b/internal/extend_docs.bzl index 7fc16068e..3ea4a8640 100644 --- a/internal/extend_docs.bzl +++ b/internal/extend_docs.bzl @@ -109,11 +109,11 @@ includes the proto package name, as well as source names, imports, and options. [proto.Package]: https://godoc.org/github.com/bazelbuild/bazel-gazelle/language/proto#Package """ -load("gazelle_binary.bzl", _gazelle_binary = "gazelle_binary") load( "//internal/generationtest:generationtest.bzl", _gazelle_generation_test = "gazelle_generation_test", ) +load("gazelle_binary.bzl", _gazelle_binary = "gazelle_binary") gazelle_binary = _gazelle_binary diff --git a/internal/go_repository.bzl b/internal/go_repository.bzl index b06937323..dd5b87771 100644 --- a/internal/go_repository.bzl +++ b/internal/go_repository.bzl @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch", "read_user_netrc", "use_netrc") load("//internal:common.bzl", "env_execute", "executable_extension") load("//internal:go_repository_cache.bzl", "read_cache_env") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch", "read_user_netrc", "use_netrc") _DOC = """ `go_repository` downloads a Go project and generates build files with Gazelle @@ -200,11 +200,11 @@ def _go_repository_impl(ctx): # not go out to the network at all. This means *the build* # goes out to the network. We tolerate this for downloading # archives, but finding module roots is a bit much. - "GOPROXY", "GONOPROXY", + "GONOSUMDB", "GOPRIVATE", + "GOPROXY", "GOSUMDB", - "GONOSUMDB", # PATH is needed to locate git and other vcs tools. "PATH", @@ -213,23 +213,23 @@ def _go_repository_impl(ctx): "HOME", # Settings below are used by vcs tools. - "SSH_AUTH_SOCK", - "SSL_CERT_FILE", - "SSL_CERT_DIR", - "HTTP_PROXY", - "HTTPS_PROXY", - "NO_PROXY", - "http_proxy", - "https_proxy", - "no_proxy", "GIT_CONFIG", + "GIT_CONFIG_COUNT", "GIT_CONFIG_GLOBAL", - "GIT_CONFIG_SYSTEM", "GIT_CONFIG_NOSYSTEM", - "GIT_SSL_CAINFO", + "GIT_CONFIG_SYSTEM", "GIT_SSH", "GIT_SSH_COMMAND", - "GIT_CONFIG_COUNT", + "GIT_SSL_CAINFO", + "HTTPS_PROXY", + "HTTP_PROXY", + "NO_PROXY", + "SSH_AUTH_SOCK", + "SSL_CERT_DIR", + "SSL_CERT_FILE", + "http_proxy", + "https_proxy", + "no_proxy", ] # Git allows passing configuration through environmental variables, this will be picked diff --git a/tests/bcr/go_mod/proto/BUILD.bazel b/tests/bcr/go_mod/proto/BUILD.bazel index d1621cc20..104a26064 100644 --- a/tests/bcr/go_mod/proto/BUILD.bazel +++ b/tests/bcr/go_mod/proto/BUILD.bazel @@ -1,6 +1,6 @@ -load("@my_rules_proto//proto:defs.bzl", "proto_library") load("@my_rules_go//go:def.bzl", "go_test") load("@my_rules_go//proto:def.bzl", "go_proto_library") +load("@my_rules_proto//proto:defs.bzl", "proto_library") proto_library( name = "foo_proto", diff --git a/tests/bcr/go_work/proto/BUILD.bazel b/tests/bcr/go_work/proto/BUILD.bazel index d1621cc20..104a26064 100644 --- a/tests/bcr/go_work/proto/BUILD.bazel +++ b/tests/bcr/go_work/proto/BUILD.bazel @@ -1,6 +1,6 @@ -load("@my_rules_proto//proto:defs.bzl", "proto_library") load("@my_rules_go//go:def.bzl", "go_test") load("@my_rules_go//proto:def.bzl", "go_proto_library") +load("@my_rules_proto//proto:defs.bzl", "proto_library") proto_library( name = "foo_proto", diff --git a/tests/cli/env_variables_test.bzl b/tests/cli/env_variables_test.bzl index fe55c6eb9..3e3312040 100644 --- a/tests/cli/env_variables_test.bzl +++ b/tests/cli/env_variables_test.bzl @@ -1,5 +1,5 @@ -load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test") load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest") +load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test") load("//:def.bzl", "gazelle") def _invalid_var_failure_test_impl(ctx):