From 346e745d263c19a4ec24cf32895c481ca5cb4f53 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Sat, 18 Feb 2023 23:37:17 -0800 Subject: [PATCH] More load visibility restrictions. Refs #67. --- common/label.bzl | 2 ++ common/label_test.bzl | 2 ++ common/paths.bzl | 2 ++ common/paths_test.bzl | 2 ++ packages/rules_prerender/css/tests/group/group_test.bzl | 2 ++ .../rules_prerender/css/tests/import_map/import_map_test.bzl | 2 ++ 6 files changed, 12 insertions(+) diff --git a/common/label.bzl b/common/label.bzl index 6f016c75..aa466638 100644 --- a/common/label.bzl +++ b/common/label.bzl @@ -1,5 +1,7 @@ """Utilities related to Bazel labels.""" +visibility("public") + def absolute( target, repository_name = native.repository_name, diff --git a/common/label_test.bzl b/common/label_test.bzl index 87a84875..b0bf89e4 100644 --- a/common/label_test.bzl +++ b/common/label_test.bzl @@ -4,6 +4,8 @@ load("@bazel_skylib//lib:partial.bzl", "partial") load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") load(":label.bzl", "absolute", "file_path_of", "rel_path") +visibility("private") + def _mock_self_repository_name(): return "@" diff --git a/common/paths.bzl b/common/paths.bzl index 56707487..e032e909 100644 --- a/common/paths.bzl +++ b/common/paths.bzl @@ -1,5 +1,7 @@ """Utilities based around file paths.""" +visibility("public") + def is_js_file(src): """Returns whether or not the given src path is a JavaScript file.""" return src.endswith(".js") or src.endswith(".mjs") or src.endswith(".cjs") diff --git a/common/paths_test.bzl b/common/paths_test.bzl index b1abaded..69605516 100644 --- a/common/paths_test.bzl +++ b/common/paths_test.bzl @@ -4,6 +4,8 @@ load("@bazel_skylib//lib:partial.bzl", "partial") load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") load(":paths.bzl", "is_js_file") +visibility("private") + def _is_js_file_impl(ctx): env = unittest.begin(ctx) diff --git a/packages/rules_prerender/css/tests/group/group_test.bzl b/packages/rules_prerender/css/tests/group/group_test.bzl index 657eb503..a6945f5d 100644 --- a/packages/rules_prerender/css/tests/group/group_test.bzl +++ b/packages/rules_prerender/css/tests/group/group_test.bzl @@ -5,6 +5,8 @@ load("//packages/rules_prerender/css:css_group.bzl", "css_group") load("//packages/rules_prerender/css:css_library.bzl", "css_library") load("//packages/rules_prerender/css:css_providers.bzl", "CssImportMapInfo") +visibility("private") + def _css_group_test_impl(ctx): env = analysistest.begin(ctx) diff --git a/packages/rules_prerender/css/tests/import_map/import_map_test.bzl b/packages/rules_prerender/css/tests/import_map/import_map_test.bzl index 7e1bd6e0..c5bca5e8 100644 --- a/packages/rules_prerender/css/tests/import_map/import_map_test.bzl +++ b/packages/rules_prerender/css/tests/import_map/import_map_test.bzl @@ -3,6 +3,8 @@ load("//packages/rules_prerender/css:css_binaries.bzl", "css_binaries") load("//packages/rules_prerender/css:css_library.bzl", "css_library") load("//packages/rules_prerender/css:css_providers.bzl", "CssImportMapInfo") +visibility("private") + def _import_map_test_impl(ctx): env = analysistest.begin(ctx)