Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Dec 14, 2023
1 parent 6f16079 commit 1e5b9e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ go_sdk.download(
use_repo(
go_sdk,
"go_toolchains",
# This name is ugly on purpose to avoid a conflict with a user-named SDK.
"io_bazel_rules_nogo",
)

Expand Down
5 changes: 4 additions & 1 deletion go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ def matches_scope(label, scope):
fail("invalid scope '%s'" % scope.name)

def _matches_scopes(label, scopes):
return any([matches_scope(label, scope) for scope in scopes])
for scope in scopes:
if matches_scope(label, scope):
return True
return False

def _get_nogo(go):
"""Returns the nogo file for this target, if enabled and in scope."""
Expand Down
3 changes: 3 additions & 0 deletions go/private/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ _nogo_tag = tag_class(
),
"includes": attr.label_list(
default = _NOGO_DEFAULT_INCLUDES,
# The special include "all" is undocumented on purpose: With it, adding a new transitive
# dependency to a Go module can cause a build failure if the new dependency has lint
# issues.
doc = """
A Go target is checked with nogo if its package matches at least one of the entries in 'includes'
and none of the entries in 'excludes'. By default, nogo is applied to all targets in the main
Expand Down

0 comments on commit 1e5b9e2

Please sign in to comment.