From dc2e1a604cf74922b10f1cad7c49ac519b3eb00e Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Wed, 9 Oct 2024 16:17:11 +0200 Subject: [PATCH] Don't call dict.pop() with named arguments 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. --- def.bzl | 2 +- internal/bzlmod/go_deps.bzl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/def.bzl b/def.bzl index 5a25bfacb..e5fa09787 100644 --- a/def.bzl +++ b/def.bzl @@ -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): diff --git a/internal/bzlmod/go_deps.bzl b/internal/bzlmod/go_deps.bzl index dcd0db37c..eaf17f96f 100644 --- a/internal/bzlmod/go_deps.bzl +++ b/internal/bzlmod/go_deps.bzl @@ -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