Skip to content

Commit a82d26f

Browse files
Googlercopybara-github
Googler
authored andcommitted
Add quotes to "Tip"
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
1 parent 6669a4f commit a82d26f

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/main/java/com/google/devtools/build/lib/packages/Package.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ private String getAlternateTargetSuggestion(String targetName) {
738738
suggestedTarget == null ? null : String.format("did you mean '%s'?", suggestedTarget);
739739
String blazeQuerySuggestion =
740740
String.format(
741-
"Tip: use `query %s:*` to see all the targets in that package",
741+
"Tip: use `query \"%s:*\"` to see all the targets in that package",
742742
packageIdentifier.getDisplayForm(mainRepositoryMapping));
743743
return String.format(
744744
" (%s)", Joiner.on(" ").skipNulls().join(targetSuggestion, blazeQuerySuggestion));

src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,8 @@ public void testHelpfulErrorForWrongPackageLabels() throws Exception {
699699
assertThat(result.hasError()).isTrue();
700700
assertContainsEvent(
701701
"no such target '//x:z': target 'z' not declared in package 'x' defined by"
702-
+ " /workspace/x/BUILD (Tip: use `query //x:*` to see all the targets in that package)"
703-
+ " and referenced by '//y:y'");
702+
+ " /workspace/x/BUILD (Tip: use `query \"//x:*\"` to see all the targets in that"
703+
+ " package) and referenced by '//y:y'");
704704
}
705705

706706
@Test

src/test/java/com/google/devtools/build/lib/packages/ExportsFilesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void testFileThatsNotRegisteredYieldsUnknownTargetException() throws Exce
6262
.isEqualTo(
6363
"no such target '//pkg:baz.txt': target 'baz.txt' not declared in package 'pkg' "
6464
+ "defined by /workspace/pkg/BUILD (did you mean 'bar.txt'? Tip: use `query "
65-
+ "//pkg:*` to see all the targets in that package)");
65+
+ "\"//pkg:*\"` to see all the targets in that package)");
6666
}
6767

6868
@Test

src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ public void testCreationOfInputFiles() throws Exception {
284284
.hasMessageThat()
285285
.isEqualTo(
286286
"no such target '//foo:A': target 'A' not declared in package 'foo' defined by"
287-
+ " /workspace/foo/BUILD (Tip: use `query //foo:*` to see all the targets in that"
288-
+ " package)");
287+
+ " /workspace/foo/BUILD (Tip: use `query \"//foo:*\"` to see all the targets in"
288+
+ " that package)");
289289

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

429429
e = assertThrows(NoSuchTargetException.class, () -> pkg.getTarget("dir"));
430430
assertThat(e)

src/test/java/com/google/devtools/build/lib/pkgcache/CompileOneDependencyTransformerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ public void testCompileOneDepOnMissingFile() throws Exception {
160160
.hasMessageThat()
161161
.isEqualTo(
162162
"no such target '//foo:missing.cc': target 'missing.cc' not declared in package "
163-
+ "'foo' defined by /workspace/foo/BUILD (Tip: use `query //foo:*` to see all the "
164-
+ "targets in that package)");
163+
+ "'foo' defined by /workspace/foo/BUILD (Tip: use `query \"//foo:*\"` to see all "
164+
+ "the targets in that package)");
165165

166166
// Also, try a valid input file which has no dependent rules in its package.
167167
e = assertThrows(TargetParsingException.class, () -> parseCompileOneDep("//foo:baz/bang"));

src/test/java/com/google/devtools/build/lib/pkgcache/PackageLoadingTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public void testGetNonexistentTarget() throws Exception {
237237
.isEqualTo(
238238
"no such target '//pkg1:not-there': target 'not-there' "
239239
+ "not declared in package 'pkg1' defined by /workspace/pkg1/BUILD (Tip: use "
240-
+ "`query //pkg1:*` to see all the targets in that package)");
240+
+ "`query \"//pkg1:*\"` to see all the targets in that package)");
241241
}
242242

243243
/**

src/test/java/com/google/devtools/build/lib/query2/testutil/AbstractQueryTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ protected final void checkResultOfTargetLiteralWithMissingTargets(
290290
"no such target '//a:b': target 'b' not declared in package 'a' "
291291
+ "defined by "
292292
+ helper.getRootDirectory().getPathString()
293-
+ "/a/BUILD (Tip: use `query //a:*` to see all the targets in that package)");
293+
+ "/a/BUILD (Tip: use `query \"//a:*\"` to see all the targets in that package)");
294294
assertThat(failureDetail.getPackageLoading().getCode())
295295
.isEqualTo(FailureDetails.PackageLoading.Code.TARGET_MISSING);
296296
}

0 commit comments

Comments
 (0)