Use canonical labels for analysistest config_settings (#2191)
With bzlmod enabled, errors like the following would occur:
```
Error in analysis_test_transition: invalid transition output '@[unknown repo '' requested from @bazel_skylib~1.3.0]//:clippy_flags': no repo visible as @ from repository '@bazel_skylib~1.3.0'
```
To resolve this, use str(Label("...")) to get the canonical label to use
as the key in config_settings.
Related issues: #2181, bazelbuild/bazel#19286
---------
Co-authored-by: UebelAndre <github@uebelandre.com>
diff --git a/test/unit/clippy/clippy_test.bzl b/test/unit/clippy/clippy_test.bzl
index 37e9592..e0e6ff7 100644
--- a/test/unit/clippy/clippy_test.bzl
+++ b/test/unit/clippy/clippy_test.bzl
@@ -84,7 +84,12 @@
binary_clippy_aspect_action_has_warnings_flag_test = make_clippy_aspect_unittest(_binary_clippy_aspect_action_has_warnings_flag_test_impl)
library_clippy_aspect_action_has_warnings_flag_test = make_clippy_aspect_unittest(_library_clippy_aspect_action_has_warnings_flag_test_impl)
test_clippy_aspect_action_has_warnings_flag_test = make_clippy_aspect_unittest(_test_clippy_aspect_action_has_warnings_flag_test_impl)
-clippy_aspect_with_explicit_flags_test = make_clippy_aspect_unittest(_clippy_aspect_with_explicit_flags_test_impl, config_settings = {"@//:clippy_flags": _CLIPPY_EXPLICIT_FLAGS})
+clippy_aspect_with_explicit_flags_test = make_clippy_aspect_unittest(
+ _clippy_aspect_with_explicit_flags_test_impl,
+ config_settings = {
+ str(Label("//:clippy_flags")): _CLIPPY_EXPLICIT_FLAGS,
+ },
+)
def clippy_test_suite(name):
"""Entry-point macro called from the BUILD file.