From 17b0f06c8451814d106d0451ee68928925a8ccac Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Thu, 15 Aug 2024 16:44:12 -0700 Subject: [PATCH] Add support for external repositories The lint rule hardcoded `@//` which meant that it could only come form the top-level repository. I'm building a third party (external) repo with lint configs and it needs to reference the rule from the appropriate external repo. --- lint/defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint/defs.bzl b/lint/defs.bzl index d4a88aa..d4abebe 100644 --- a/lint/defs.bzl +++ b/lint/defs.bzl @@ -33,7 +33,7 @@ def get_lint_config(linter_name, tags): return None if native.existing_rule("%s_%s" % (OVERRIDE_RULE_NAME, linter_name)) != None: - return Label("@//%s:%s_%s" % (native.package_name(), OVERRIDE_RULE_NAME, linter_name)) + return Label("@%s//%s:%s_%s" % (native.repo_name(), native.package_name(), OVERRIDE_RULE_NAME, linter_name)) if linter_name in configured_linters: return Label("@apple_linters//:%s_%s" % (OVERRIDE_RULE_NAME, linter_name))