Skip to content

Commit

Permalink
Reformat with buildifier (#3910)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum authored Apr 3, 2024
1 parent daf15ef commit c0ef535
Show file tree
Hide file tree
Showing 36 changed files with 189 additions and 186 deletions.
24 changes: 12 additions & 12 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
load(
"//go/private/tools:lines_sorted_test.bzl",
"lines_sorted_test",
)
load(
"//go/private/rules:nogo.bzl",
"nogo",
)
load(
"//go/private/rules:info.bzl",
"go_info",
)
load(
"//go:def.bzl",
"TOOLS_NOGO",
Expand All @@ -21,10 +9,22 @@ load(
"go_config",
"go_context_data",
)
load(
"//go/private/rules:info.bzl",
"go_info",
)
load(
"//go/private/rules:nogo.bzl",
"nogo",
)
load(
"//go/private/rules:stdlib.bzl",
"stdlib",
)
load(
"//go/private/tools:lines_sorted_test.bzl",
"lines_sorted_test",
)

# gazelle:prefix github.com/bazelbuild/rules_go
# gazelle:exclude tests
Expand Down
4 changes: 2 additions & 2 deletions docs/doc_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
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")

def stardoc_with_diff_test(
bzl_library_target,
Expand Down
6 changes: 3 additions & 3 deletions docs/go/core/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ Rules
"""

load("//go/private/rules:library.bzl", _go_library = "go_library")
load("//go/private/rules:binary.bzl", _go_binary = "go_binary")
load("//go/private/rules:test.bzl", _go_test = "go_test")
load("//go/private/rules:cross.bzl", _go_cross_binary = "go_cross_binary")
load("//go/private/rules:library.bzl", _go_library = "go_library")
load("//go/private/rules:source.bzl", _go_source = "go_source")
load("//go/private/rules:test.bzl", _go_test = "go_test")
load("//go/private/tools:path.bzl", _go_path = "go_path")
load("//go/private/rules:cross.bzl", _go_cross_binary = "go_cross_binary")

go_library = _go_library
go_binary = _go_binary
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-gazelle/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

# gazelle:prefix github.com/bazelbuild/rules_go/examples/basic-gazelle
gazelle(name = "gazelle")
Expand Down
6 changes: 3 additions & 3 deletions examples/basic-gazelle/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ http_archive(
],
)

# Load rules_go ruleset and expose the toolchain and dep rules.
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

# the line below instructs gazelle to save the go dependency definitions
# in the deps.bzl file. Located under '//'.
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

# Load rules_go ruleset and expose the toolchain and dep rules.
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
Expand Down
6 changes: 3 additions & 3 deletions extras/gomock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# The rules in this files are still under development. Breaking changes are planned.
# DO NOT USE IT.

load("//go/private:context.bzl", "go_context")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//go/private:common.bzl", "GO_TOOLCHAIN", "GO_TOOLCHAIN_LABEL")
load("//go/private/rules:wrappers.bzl", go_binary = "go_binary_macro")
load("//go/private:context.bzl", "go_context")
load("//go/private:providers.bzl", "GoLibrary")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//go/private/rules:wrappers.bzl", go_binary = "go_binary_macro")

_MOCKGEN_TOOL = Label("//extras/gomock:mockgen")
_MOCKGEN_MODEL_LIB = Label("//extras/gomock:mockgen_model")
Expand Down
44 changes: 22 additions & 22 deletions go/def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ Definitions outside this file are private unless otherwise noted, and
may change without notice.
"""

load(
"//extras:gomock.bzl",
_gomock = "gomock",
)
load(
"//go/private:context.bzl",
_go_context = "go_context",
)
load(
"//go/private:go_toolchain.bzl",
_go_toolchain = "go_toolchain",
)
load(
"//go/private:providers.bzl",
_GoArchive = "GoArchive",
Expand All @@ -36,43 +44,35 @@ load(
_GoSource = "GoSource",
)
load(
"//go/private/rules:sdk.bzl",
_go_sdk = "go_sdk",
"//go/private/rules:cross.bzl",
_go_cross_binary = "go_cross_binary",
)
load(
"//go/private:go_toolchain.bzl",
_go_toolchain = "go_toolchain",
"//go/private/rules:library.bzl",
_go_tool_library = "go_tool_library",
)
load(
"//go/private/rules:wrappers.bzl",
_go_binary_macro = "go_binary_macro",
_go_library_macro = "go_library_macro",
_go_test_macro = "go_test_macro",
"//go/private/rules:nogo.bzl",
_nogo = "nogo_wrapper",
)
load(
"//go/private/rules:sdk.bzl",
_go_sdk = "go_sdk",
)
load(
"//go/private/rules:source.bzl",
_go_source = "go_source",
)
load(
"//extras:gomock.bzl",
_gomock = "gomock",
"//go/private/rules:wrappers.bzl",
_go_binary_macro = "go_binary_macro",
_go_library_macro = "go_library_macro",
_go_test_macro = "go_test_macro",
)
load(
"//go/private/tools:path.bzl",
_go_path = "go_path",
)
load(
"//go/private/rules:library.bzl",
_go_tool_library = "go_tool_library",
)
load(
"//go/private/rules:nogo.bzl",
_nogo = "nogo_wrapper",
)
load(
"//go/private/rules:cross.bzl",
_go_cross_binary = "go_cross_binary",
)

_TOOLS_NOGO = [
"@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library",
Expand Down
8 changes: 4 additions & 4 deletions go/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
# declared here, but at the time this file is loaded, we can't assume
# anything has been declared.

load(
"//go/private:nogo.bzl",
"go_register_nogo_wrapper",
)
load(
"//go/private:repositories.bzl",
_go_rules_dependencies = "go_rules_dependencies",
Expand All @@ -30,10 +34,6 @@ load(
_go_register_toolchains = "go_register_toolchains",
_go_wrap_sdk = "go_wrap_sdk",
)
load(
"//go/private:nogo.bzl",
"go_register_nogo_wrapper",
)

go_rules_dependencies = _go_rules_dependencies
go_register_toolchains = _go_register_toolchains
Expand Down
6 changes: 3 additions & 3 deletions go/private/BUILD.sdk.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_sdk")
load("@io_bazel_rules_go//go/private:common.bzl", "RULES_GO_STDLIB_PREFIX")
load("@io_bazel_rules_go//go/private:go_toolchain.bzl", "declare_go_toolchains")
load("@io_bazel_rules_go//go/private/rules:binary.bzl", "go_tool_binary")
load("@io_bazel_rules_go//go/private/rules:sdk.bzl", "package_list")
load("@io_bazel_rules_go//go/private/rules:transition.bzl", "non_go_reset_target")
load("@io_bazel_rules_go//go/private:common.bzl", "RULES_GO_STDLIB_PREFIX")
load("@io_bazel_rules_go//go/private:go_toolchain.bzl", "declare_go_toolchains")
load("@io_bazel_rules_go//go:def.bzl", "go_sdk")

package(default_visibility = ["//visibility:public"])

Expand Down
8 changes: 4 additions & 4 deletions go/private/actions/archive.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ load(
"effective_importpath_pkgpath",
"get_archive",
)
load(
"//go/private/rules:cgo.bzl",
"cgo_configure",
)
load(
"//go/private/actions:compilepkg.bzl",
"emit_compilepkg",
)
load(
"//go/private/rules:cgo.bzl",
"cgo_configure",
)

def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_deps = None):
"""See go/toolchains.rst#archive for full documentation."""
Expand Down
10 changes: 5 additions & 5 deletions go/private/actions/binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load(
"//go/private:common.bzl",
"ARCHIVE_EXTENSION",
"has_shared_lib_extension",
)
load(
"//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"LINKMODE_PLUGIN",
)
load(
"//go/private:common.bzl",
"ARCHIVE_EXTENSION",
"has_shared_lib_extension",
)

def emit_binary(
go,
Expand Down
8 changes: 4 additions & 4 deletions go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load(
"@bazel_skylib//lib:collections.bzl",
"collections",
)
load(
"//go/private:common.bzl",
"GO_TOOLCHAIN_LABEL",
Expand All @@ -30,10 +34,6 @@ load(
"//go/private:rpath.bzl",
"rpath",
)
load(
"@bazel_skylib//lib:collections.bzl",
"collections",
)

def _format_archive(d):
return "{}={}={}".format(d.label, d.importmap, d.file.path)
Expand Down
8 changes: 4 additions & 4 deletions go/private/actions/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ load(
"COVERAGE_OPTIONS_DENYLIST",
"GO_TOOLCHAIN_LABEL",
)
load(
"//go/private:providers.bzl",
"GoStdLib",
)
load(
"//go/private:mode.bzl",
"LINKMODE_NORMAL",
"extldflags_from_cc_toolchain",
"link_mode_args",
)
load(
"//go/private:providers.bzl",
"GoStdLib",
)
load("//go/private:sdk.bzl", "parse_version")
load("//go/private/actions:utils.bzl", "quote_opts")

Expand Down
62 changes: 31 additions & 31 deletions go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go_bazel_features//:features.bzl", "bazel_features")
load(
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
"find_cpp_toolchain",
"@bazel_skylib//rules:common_settings.bzl",
"BuildSettingInfo",
)
load(
"@bazel_tools//tools/build_defs/cc:action_names.bzl",
Expand All @@ -28,23 +27,22 @@ load(
"OBJC_COMPILE_ACTION_NAME",
)
load(
":providers.bzl",
"CgoContextInfo",
"EXPLICIT_PATH",
"EXPORT_PATH",
"GoArchive",
"GoConfigInfo",
"GoContextInfo",
"GoLibrary",
"GoSource",
"GoStdLib",
"INFERRED_PATH",
"get_source",
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
"find_cpp_toolchain",
)
load("@io_bazel_rules_go_bazel_features//:features.bzl", "bazel_features")
load(
":mode.bzl",
"get_mode",
"installsuffix",
"@io_bazel_rules_nogo//:scope.bzl",
NOGO_EXCLUDES = "EXCLUDES",
NOGO_INCLUDES = "INCLUDES",
)
load(
"//go/platform:apple.bzl",
"apple_ensure_options",
)
load(
"//go/private/rules:transition.bzl",
"request_nogo_transition",
)
load(
":common.bzl",
Expand All @@ -56,21 +54,23 @@ load(
"is_struct",
)
load(
"//go/platform:apple.bzl",
"apple_ensure_options",
)
load(
"@bazel_skylib//rules:common_settings.bzl",
"BuildSettingInfo",
)
load(
"//go/private/rules:transition.bzl",
"request_nogo_transition",
":mode.bzl",
"get_mode",
"installsuffix",
)
load(
"@io_bazel_rules_nogo//:scope.bzl",
NOGO_EXCLUDES = "EXCLUDES",
NOGO_INCLUDES = "INCLUDES",
":providers.bzl",
"CgoContextInfo",
"EXPLICIT_PATH",
"EXPORT_PATH",
"GoArchive",
"GoConfigInfo",
"GoContextInfo",
"GoLibrary",
"GoSource",
"GoStdLib",
"INFERRED_PATH",
"get_source",
)

# cgo requires a gcc/clang style compiler.
Expand Down
Loading

0 comments on commit c0ef535

Please sign in to comment.