Skip to content

Commit

Permalink
Add quotes to "Tip"
Browse files Browse the repository at this point in the history
Add double quotes to the tip so that it can be copied and pasted and work from a shell. Just an ease of use thing.

PiperOrigin-RevId: 483980588
Change-Id: If5f87cb52d7d20da2ab8423800c68ea7b332a5fd
  • Loading branch information
Googler authored and Copybara-Service committed Oct 26, 2022
1 parent 6669a4f commit a82d26f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Expand Up @@ -738,7 +738,7 @@ private String getAlternateTargetSuggestion(String targetName) {
suggestedTarget == null ? null : String.format("did you mean '%s'?", suggestedTarget);
String blazeQuerySuggestion =
String.format(
"Tip: use `query %s:*` to see all the targets in that package",
"Tip: use `query \"%s:*\"` to see all the targets in that package",
packageIdentifier.getDisplayForm(mainRepositoryMapping));
return String.format(
" (%s)", Joiner.on(" ").skipNulls().join(targetSuggestion, blazeQuerySuggestion));
Expand Down
Expand Up @@ -699,8 +699,8 @@ public void testHelpfulErrorForWrongPackageLabels() throws Exception {
assertThat(result.hasError()).isTrue();
assertContainsEvent(
"no such target '//x:z': target 'z' not declared in package 'x' defined by"
+ " /workspace/x/BUILD (Tip: use `query //x:*` to see all the targets in that package)"
+ " and referenced by '//y:y'");
+ " /workspace/x/BUILD (Tip: use `query \"//x:*\"` to see all the targets in that"
+ " package) and referenced by '//y:y'");
}

@Test
Expand Down
Expand Up @@ -62,7 +62,7 @@ public void testFileThatsNotRegisteredYieldsUnknownTargetException() throws Exce
.isEqualTo(
"no such target '//pkg:baz.txt': target 'baz.txt' not declared in package 'pkg' "
+ "defined by /workspace/pkg/BUILD (did you mean 'bar.txt'? Tip: use `query "
+ "//pkg:*` to see all the targets in that package)");
+ "\"//pkg:*\"` to see all the targets in that package)");
}

@Test
Expand Down
Expand Up @@ -284,8 +284,8 @@ public void testCreationOfInputFiles() throws Exception {
.hasMessageThat()
.isEqualTo(
"no such target '//foo:A': target 'A' not declared in package 'foo' defined by"
+ " /workspace/foo/BUILD (Tip: use `query //foo:*` to see all the targets in that"
+ " package)");
+ " /workspace/foo/BUILD (Tip: use `query \"//foo:*\"` to see all the targets in"
+ " that package)");

// These are the only input files: BUILD, Z
Set<String> inputFiles = Sets.newTreeSet();
Expand Down Expand Up @@ -423,8 +423,8 @@ public void testHelpfulErrorForMissingExportsFiles() throws Exception {
.hasMessageThat()
.isEqualTo(
"no such target '//x:z.cc': target 'z.cc' not declared in package 'x' defined by"
+ " /workspace/x/BUILD (did you mean 'x.cc'? Tip: use `query //x:*` to see all the"
+ " targets in that package)");
+ " /workspace/x/BUILD (did you mean 'x.cc'? Tip: use `query \"//x:*\"` to see all"
+ " the targets in that package)");

e = assertThrows(NoSuchTargetException.class, () -> pkg.getTarget("dir"));
assertThat(e)
Expand Down
Expand Up @@ -160,8 +160,8 @@ public void testCompileOneDepOnMissingFile() throws Exception {
.hasMessageThat()
.isEqualTo(
"no such target '//foo:missing.cc': target 'missing.cc' not declared in package "
+ "'foo' defined by /workspace/foo/BUILD (Tip: use `query //foo:*` to see all the "
+ "targets in that package)");
+ "'foo' defined by /workspace/foo/BUILD (Tip: use `query \"//foo:*\"` to see all "
+ "the targets in that package)");

// Also, try a valid input file which has no dependent rules in its package.
e = assertThrows(TargetParsingException.class, () -> parseCompileOneDep("//foo:baz/bang"));
Expand Down
Expand Up @@ -237,7 +237,7 @@ public void testGetNonexistentTarget() throws Exception {
.isEqualTo(
"no such target '//pkg1:not-there': target 'not-there' "
+ "not declared in package 'pkg1' defined by /workspace/pkg1/BUILD (Tip: use "
+ "`query //pkg1:*` to see all the targets in that package)");
+ "`query \"//pkg1:*\"` to see all the targets in that package)");
}

/**
Expand Down
Expand Up @@ -290,7 +290,7 @@ protected final void checkResultOfTargetLiteralWithMissingTargets(
"no such target '//a:b': target 'b' not declared in package 'a' "
+ "defined by "
+ helper.getRootDirectory().getPathString()
+ "/a/BUILD (Tip: use `query //a:*` to see all the targets in that package)");
+ "/a/BUILD (Tip: use `query \"//a:*\"` to see all the targets in that package)");
assertThat(failureDetail.getPackageLoading().getCode())
.isEqualTo(FailureDetails.PackageLoading.Code.TARGET_MISSING);
}
Expand Down

0 comments on commit a82d26f

Please sign in to comment.