Skip to content

Commit

Permalink
Don't call dict.pop() with named arguments
Browse files Browse the repository at this point in the history
Even though Bazel is fine with the code as is, Go Starlark's dict.pop()
only takes positional arguments. My assumption is that this is correct,
because Python does so as well.
  • Loading branch information
EdSchouten committed Oct 9, 2024
1 parent 4e16eed commit dc2e1a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _gazelle_kwargs_prepare(name, kwargs):
kwargs["extra_args"] = kwargs["args"]
kwargs.pop("args")

visibility = kwargs.pop("visibility", default = None)
visibility = kwargs.pop("visibility", None)
return name + "-runner", visibility

def gazelle(name, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions internal/bzlmod/go_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ def _go_deps_impl(module_ctx):
for path, module in module_resolutions.items():
if hasattr(module, "module_name"):
# Do not create a go_repository for a Go module provided by a bazel_dep.
root_module_direct_deps.pop(_repo_name(path), default = None)
root_module_direct_dev_deps.pop(_repo_name(path), default = None)
root_module_direct_deps.pop(_repo_name(path), None)
root_module_direct_dev_deps.pop(_repo_name(path), None)
continue
if getattr(module_ctx, "is_isolated", False) and path in _SHARED_REPOS:
# Do not create a go_repository for a dep shared with the non-isolated instance of
Expand Down

0 comments on commit dc2e1a6

Please sign in to comment.