Commit 5c11b412 authored by Benjamin Peterson's avatar Benjamin Peterson Committed by Adam Cozzette

Improve the grammar of the unused import message.

parent a32c2d03
...@@ -884,7 +884,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafFirst) { ...@@ -884,7 +884,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafFirst) {
Run("protocol_compiler --test_out=$tmpdir " Run("protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir bar.proto foo.proto"); "--proto_path=$tmpdir bar.proto foo.proto");
ExpectWarningSubstring( ExpectWarningSubstring(
"bar.proto:2:1: warning: Import unused.proto but not used."); "bar.proto:2:1: warning: Import unused.proto is unused.");
} }
TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) { TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) {
...@@ -905,7 +905,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) { ...@@ -905,7 +905,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) {
Run("protocol_compiler --test_out=$tmpdir " Run("protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir foo.proto bar.proto"); "--proto_path=$tmpdir foo.proto bar.proto");
ExpectWarningSubstring( ExpectWarningSubstring(
"bar.proto:2:1: warning: Import unused.proto but not used."); "bar.proto:2:1: warning: Import unused.proto is unused.");
} }
TEST_F(CommandLineInterfaceTest, CreateDirectory) { TEST_F(CommandLineInterfaceTest, CreateDirectory) {
......
...@@ -7125,7 +7125,7 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto, ...@@ -7125,7 +7125,7 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
unused_dependency_.begin(); unused_dependency_.begin();
it != unused_dependency_.end(); ++it) { it != unused_dependency_.end(); ++it) {
// Log warnings for unused imported files. // Log warnings for unused imported files.
std::string error_message = "Import " + (*it)->name() + " but not used."; std::string error_message = "Import " + (*it)->name() + " is unused.";
AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT, AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
error_message); error_message);
} }
......
...@@ -3479,7 +3479,7 @@ TEST(CustomOptions, UnusedImportWarning) { ...@@ -3479,7 +3479,7 @@ TEST(CustomOptions, UnusedImportWarning) {
EXPECT_EQ( EXPECT_EQ(
"custom_options_import.proto: " "custom_options_import.proto: "
"google/protobuf/unittest_custom_options.proto: IMPORT: Import " "google/protobuf/unittest_custom_options.proto: IMPORT: Import "
"google/protobuf/unittest_custom_options.proto but not used.\n", "google/protobuf/unittest_custom_options.proto is unused.\n",
error_collector.warning_text_); error_collector.warning_text_);
EXPECT_EQ("", error_collector.text_); EXPECT_EQ("", error_collector.text_);
} }
...@@ -5795,7 +5795,7 @@ TEST_F(ValidationErrorTest, UnusedImportWarning) { ...@@ -5795,7 +5795,7 @@ TEST_F(ValidationErrorTest, UnusedImportWarning) {
" field { name:\"base\" number:1 label:LABEL_OPTIONAL " " field { name:\"base\" number:1 label:LABEL_OPTIONAL "
"type_name:\"Base\" }" "type_name:\"Base\" }"
"}", "}",
"forward.proto: bar.proto: IMPORT: Import bar.proto but not used.\n"); "forward.proto: bar.proto: IMPORT: Import bar.proto is unused.\n");
} }
namespace { namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment