Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run buildifier #1480

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This is in a separate package from both the stardoc source files and the
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("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
Expand All @@ -22,7 +23,10 @@ _DOC_SRCS = {
input = input + ".bzl",
deps = [input],
)
for [input, out] in _DOC_SRCS.items()
for [
input,
out,
] in _DOC_SRCS.items()
]

[
Expand Down
2 changes: 1 addition & 1 deletion internal/gazelle_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ def format_import(importpath):
return '{} "{}"'.format(_import_alias(importpath), importpath)

def format_call(importpath):
return _import_alias(importpath)+".NewLanguage()"
return _import_alias(importpath) + ".NewLanguage()"
5 changes: 2 additions & 3 deletions internal/go_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ Authorization: Bearer RANDOM-TOKEN
</pre>
"""


# We can't disable timeouts on Bazel, but we can set them to large values.
_GO_REPOSITORY_TIMEOUT = 86400

Expand Down Expand Up @@ -396,7 +395,7 @@ go_repository = repository_rule(
`replace` will be downloaded at `version` and verified with `sum`.

NOTE: There is no `go_repository` equivalent to file path `replace`
directives. Use `local_repository` instead."""
directives. Use `local_repository` instead.""",
),

# Attributes for a repository that needs automatic build file generation
Expand Down Expand Up @@ -520,7 +519,7 @@ go_repository = repository_rule(
so this defaults to `False`. However, setting to `True` can be useful for debugging build failures and
unexpected behavior for the given rule.
""",
)
),
},
)
"""See repository.md#go-repository for full documentation."""
3 changes: 1 addition & 2 deletions internal/overlay_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ http_archive(

The file format of the repository archive. This is normally inferred from
the downloaded file name.""",

),
"overlay": attr.label_keyed_string_dict(
allow_files = True,
Expand All @@ -84,7 +83,7 @@ http_archive(
where the overlay files should be written.

It's convenient to store the overlay dictionaries for all repositories in
a separate .bzl file. See Gazelle's `manifest.bzl`_ for an example."""
a separate .bzl file. See Gazelle's `manifest.bzl`_ for an example.""",
),
},
)
Expand Down
5 changes: 3 additions & 2 deletions internal/repository_docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ $ gazelle update-repos github.com/pkg/errors
"""

load("go_repository.bzl", _go_repository = "go_repository")
load("overlay_repository.bzl",
_http_archive = "http_archive",
load(
"overlay_repository.bzl",
_git_repository = "git_repository",
_http_archive = "http_archive",
)

go_repository = _go_repository
Expand Down
6 changes: 3 additions & 3 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ load("//:def.bzl", "gazelle_generation_test")
# This test Gazelle binary only has the "test_filegroup" plugin installed.
gazelle_binary(
name = "gazelle",
visibility = ["//visibility:private"],
languages = [
"//internal/language/test_filegroup",
],
visibility = ["//visibility:private"],
)

gazelle_binary(
name = "gazelle_with_language_loads_from_flag",
visibility = ["//visibility:private"],
languages = [
"//internal/language/test_loads_from_flag",
],
visibility = ["//visibility:private"],
)

[gazelle_generation_test(
Expand All @@ -31,7 +31,7 @@ gazelle_binary(
# gazelle_generation_test accepts setting common test attributes.
local = False,
test_data = glob(
include = [file[0:-len("/WORKSPACE")] + "/**"],
include = [file[0:-len("/WORKSPACE")] + "/**"],
),
) for file in glob(
include = ["**/WORKSPACE"],
Expand Down
9 changes: 5 additions & 4 deletions tests/bcr/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ go_deps.module(
sum = "h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=",
version = "v1.8.0",
)

# Transitive dependencies have to be listed here explicitly.
go_deps.module(
path = "gopkg.in/yaml.v3",
Expand All @@ -37,8 +38,8 @@ go_deps.module(
)
use_repo(
go_deps,
"com_github_pelletier_go_toml",
"com_github_stretchr_testify",
# It is not necessary to list transitive dependencies here, only direct ones.
# "in_gopkg_yaml_v3",
"com_github_pelletier_go_toml",
"com_github_stretchr_testify",
# It is not necessary to list transitive dependencies here, only direct ones.
# "in_gopkg_yaml_v3",
)