Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.0] Show "did you mean" suggestion for {override,inject}_repo #24003

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ java_library(
"//src/main/java/com/google/devtools/build/skyframe:skyframe-objects",
"//src/main/java/net/starlark/java/annot",
"//src/main/java/net/starlark/java/eval",
"//src/main/java/net/starlark/java/spelling",
"//src/main/java/net/starlark/java/syntax",
"//src/main/protobuf:failure_details_java_proto",
"//third_party:auto_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.starlark.java.eval.EvalException;
import net.starlark.java.eval.Starlark;
import net.starlark.java.eval.StarlarkThread;
import net.starlark.java.spelling.SpellChecker;
import net.starlark.java.syntax.Location;

/** Context object for a Starlark thread evaluating the MODULE.bazel file and files it includes. */
Expand Down Expand Up @@ -255,8 +256,11 @@ ModuleExtensionUsage buildUsage() throws EvalException {
if (!context.repoNameUsages.containsKey(overridingRepoName)) {
throw Starlark.errorf(
"The repo exported as '%s' by module extension '%s' is overridden with '%s', but"
+ " no repo is visible under this name",
overriddenRepoName, extensionName, overridingRepoName)
+ " no repo is visible under this name%s",
overriddenRepoName,
extensionName,
overridingRepoName,
SpellChecker.didYouMean(overridingRepoName, context.repoNameUsages.keySet()))
.withCallStack(override.getValue().stack);
}
String importedAs = imports.inverse().get(overriddenRepoName);
Expand Down
Loading