Skip to content

Commit

Permalink
chore: bump checkers typos version so it works on mac and fix typos (#…
Browse files Browse the repository at this point in the history
…7693)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/googleapis/google-cloud-cpp/7693)
<!-- Reviewable:end -->
  • Loading branch information
dpcollins-google authored Dec 3, 2021
1 parent b44055b commit edbe664
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 56 deletions.
16 changes: 16 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[files]
extend-exclude = [
# Autogenerated
"google/cloud/bigtable/internal/readrowsparser_acceptance_tests.inc",
# Files with crypto-keys in them
"google/cloud/internal/grpc_service_account_authentication_test.cc",
"google/cloud/storage/client_options_test.cc",
"google/cloud/storage/client_sign_policy_document_test.cc",
"google/cloud/storage/client_sign_url_test.cc",
"google/cloud/storage/oauth2/google_credentials_test.cc",
"google/cloud/storage/oauth2/service_account_credentials_test.cc",
"google/cloud/storage/testing/constants.h",
"google/cloud/storage/tests/test_service_account.not-a-test.json",
"google/cloud/storage/tests/unified_credentials_integration_test.cc",
"google/cloud/storage/tools/make_jwt_assertion_for_test_data.py",
]
2 changes: 1 addition & 1 deletion ci/cloudbuild/dockerfiles/checkers.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ RUN pip3 install --upgrade pip
RUN pip3 install cmake_format==0.6.8
RUN pip3 install black==19.3b0

RUN cargo install typos-cli --version 1.0.3 --root /usr/local
RUN cargo install typos-cli --version 1.3.1 --root /usr/local
2 changes: 1 addition & 1 deletion ci/cloudbuild/notifiers/bigquery/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# There are a few commmands that need to be run in order to re-deploy a change
# There are a few commands that need to be run in order to re-deploy a change
# to the bigquery.yaml file, and this script runs those commands. These
# commands are enough to RE-deploy the service, but there are about 10
# additional commands needed to set up the service in the first place. See
Expand Down
2 changes: 1 addition & 1 deletion ci/lib/io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This bash library includes various I/O funtions, including logging functions.
# This bash library includes various I/O functions, including logging functions.
#
# Example:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the server is going to validate its inputs as well. Furthermore, any such
validation is wasteful: most of the time the application will pass on valid
arguments, checking them twice is just wasting client-side CPU cycles. Moreover,
the server-side is the source of truth, so having the validations performed on
the client side wil require extra work if the server restrictions are ever
the client side will require extra work if the server restrictions are ever
modified.

**Decision**: the client libraries do not validate any of the request
Expand Down
2 changes: 1 addition & 1 deletion generator/internal/codegen_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST(CamelCaseToSnakeCase, Success) {
EXPECT_EQ("foo_bar_b", CamelCaseToSnakeCase("FooBarB"));
EXPECT_EQ("foo_bar_baz", CamelCaseToSnakeCase("FooBarBaz"));
EXPECT_EQ("foo_bar_baz", CamelCaseToSnakeCase("fooBarBaz"));
EXPECT_EQ("foo_bar_ba", CamelCaseToSnakeCase("fooBarBa"));
EXPECT_EQ("foo_bar_ab", CamelCaseToSnakeCase("fooBarAb"));
EXPECT_EQ("foo_bar_baaaaa", CamelCaseToSnakeCase("fooBarBAAAAA"));
EXPECT_EQ("foo_bar_b", CamelCaseToSnakeCase("foo_BarB"));
EXPECT_EQ("v1", CamelCaseToSnakeCase("v1"));
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/async_row_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ TEST_F(TableAsyncReadRowsTest, MultipleChunksImmediatelySatisfied) {
ASSERT_EQ(0U, cq_impl_->size());
}

/// @test Verify that a single row can span mutiple responses.
/// @test Verify that a single row can span multiple responses.
TEST_F(TableAsyncReadRowsTest, ResponseInMultipleChunks) {
auto& stream = AddReader([](btproto::ReadRowsRequest const&) {});

Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigtable/doc/bigtable-samples-data-client.dox
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
@page bigtable-samples-data-client Example: Advanced Reading and Writing Samples

This example is for advanced reading and writing opertions on bigtable data client, that illustrates how to:
This example is for advanced reading and writing operations on bigtable data client, that illustrates how to:

- Use ReadModifyWrite to append a string to a value.
- Use ReadModifyWrite to increment a value.
Expand Down Expand Up @@ -29,7 +29,7 @@ The example uses the following headers:

@snippet data_snippets.cc connect data

### Use ReadModifyWrite to increament a value and append a string to a value.
### Use ReadModifyWrite to increment a value and append a string to a value.

@snippet data_snippets.cc read modify write

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/examples/data_filter_snippets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void FilterLimitRowRegex(google::cloud::bigtable::Table table,
namespace cbt = ::google::cloud::bigtable;
using ::google::cloud::StatusOr;
[](cbt::Table table) {
// Filter the results, only include rows where row_key matchs given regular
// Filter the results, only include rows where row_key matches given regular
// expression
cbt::Filter filter = cbt::Filter::RowKeysRegex(".*#20190501$");
// Read and print the rows.
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/mutation_batcher_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ TEST_F(MutationBatcherTest, ApplyCompletesImmediately) {
});
EXPECT_CALL(*reader, StartCall).Times(1);
batcher_raw_ptr->SetOnBulkApply([this] {
// Simulate completion queue finishing this stream before contol is
// Simulate completion queue finishing this stream before control is
// returned from AsyncBulkApplyImpl
std::async([this] {
cq_impl_->SimulateCompletion(true);
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/mutations_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ TEST(MutationsTest, FailedMutation) {
}

/// @test Verify that MultipleRowMutations works as expected.
TEST(MutationsTest, MutipleRowMutations) {
TEST(MutationsTest, MultipleRowMutations) {
BulkMutation actual;

// Prepare a non-empty request to verify MoveTo() does something.
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct InstanceAdminEndpointOption {
/**
* Minimum time in ms to refresh connections.
*
* The server wll not disconnect idle connections before this time.
* The server will not disconnect idle connections before this time.
*/
struct MinConnectionRefreshOption {
using Type = std::chrono::milliseconds;
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/row_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ TEST_F(RowReaderTest, FailedParseWithNoRetryThrowsNoExcept) {
EXPECT_FALSE(*it);
}

TEST_F(RowReaderTest, FailedStreamWithAllRequiedRowsSeenShouldNotRetry) {
TEST_F(RowReaderTest, FailedStreamWithAllRequiredRowsSeenShouldNotRetry) {
// wrapped in unique_ptr by ReadRows
auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows");
auto parser = absl::make_unique<ReadRowsParserMock>();
Expand Down
12 changes: 6 additions & 6 deletions google/cloud/internal/base64_transforms_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ TEST(Base64, RFC4648TestVectors) {
// https://tools.ietf.org/html/rfc4648#section-10
std::vector<std::pair<std::string, std::string>> test_cases = {
{"", ""},
{"f", "Zg=="},
{"fo", "Zm8="},
{"foo", "Zm9v"},
{"foob", "Zm9vYg=="},
{"fooba", "Zm9vYmE="},
{"foobar", "Zm9vYmFy"},
{"a", "YQ=="},
{"ab", "YWI="},
{"abc", "YWJj"},
{"abcd", "YWJjZA=="},
{"abcde", "YWJjZGU="},
{"abcdef", "YWJjZGVm"},
};
for (auto const& test_case : test_cases) {
Base64Encoder enc;
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/spanner/row_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ TEST(Row, TemplatedGetAsTuple) {
EXPECT_EQ(std::make_tuple(1, "blah", true), *std::move(row).get<RowType>());
}

TEST(MakeTestRow, ExplicitColumNames) {
TEST(MakeTestRow, ExplicitColumnNames) {
auto row = MakeTestRow({{"a", Value(42)}, {"b", Value(52)}});
EXPECT_EQ(Value(42), *row.get("a"));
EXPECT_EQ(Value(52), *row.get("b"));
}

TEST(MakeTestRow, ImplicitColumNames) {
TEST(MakeTestRow, ImplicitColumnNames) {
auto row = MakeTestRow(42, 52);
EXPECT_EQ(Value(42), *row.get("0"));
EXPECT_EQ(Value(52), *row.get("1"));
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/storage/benchmarks/throughput_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ enum OpType {
/// an
/// equivalent function.
kOpInsert,
/// The experiment performed a downlad, using Client::InsertObject() or an
/// The experiment performed a download, using Client::InsertObject() or an
/// equivalent function.
/// This was the first download of this object in the experiment.
// TODO(#4350) - use a separate field to count downloads / uploads
kOpRead0,
/// The experiment performed a downlad, using Client::InsertObject() or an
/// The experiment performed a download, using Client::InsertObject() or an
/// equivalent function.
/// This was the second download of this object in the experiment.
kOpRead1,
/// The experiment performed a downlad, using Client::InsertObject() or an
/// The experiment performed a download, using Client::InsertObject() or an
/// equivalent function.
/// This was the third download of this object in the experiment.
kOpRead2,
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/client_write_object_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ TEST_F(WriteObjectTest, WriteObjectErrorInChunk) {
.WillOnce(Return(Status(StatusCode::kDataLoss, "ooops")));
EXPECT_CALL(*mock, session_id()).WillRepeatedly(ReturnRef(session_id));
// The call to Close() below should have no effect and no "final" chunk
// should be uplaoded.
// should be uploaded.
EXPECT_CALL(*mock, UploadFinalChunk).Times(0);

return make_status_or(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The actual contents are not interesting.
std::cout << "\nRunning the MakeObjectPublic() example" << std::endl;
MakeObjectPublic(client, {bucket_name, object_name});

std::cout << "\nRunning the ReadObjectUnathenticated() example" << std::endl;
std::cout << "\nRunning the ReadObjectUnauthenticated() example" << std::endl;
ReadObjectUnauthenticated({bucket_name, object_name});

(void)client.DeleteObject(bucket_name, object_name);
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/internal/bucket_requests_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST(BucketMetadataParserTest, ParseAclFailure) {
}

/// @test Verify that we parse JSON objects into BucketMetadata objects.
TEST(BucketMetadataParserTest, ParseDefaultObjecAclFailure) {
TEST(BucketMetadataParserTest, ParseDefaultObjectAclFailure) {
auto actual = internal::BucketMetadataParser::FromString(
R"""({"defaultObjectAcl: ["invalid-item"]})""");
EXPECT_THAT(actual, Not(IsOk()));
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/internal/http_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ StatusCode MapHttpCodeToStatus(long code) { // NOLINT(google-runtime-int)
// "@type": "type.googleapis.com/google.rpc.ErrorInfo",
// "reason": "..."
// "domain": "..."
// "metdata": {
// "metadata": {
// "key1": "value1"
// ...
// }
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/internal/make_jwt_assertion_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TEST(MakeJWTAssertionNoThrow, Basic) {
{"exp", "1511903600"},
};
auto const assertion = MakeJWTAssertionNoThrow(header.dump(), payload.dump(),
testing::kWellFormatedKey);
testing::kWellFormattedKey);
ASSERT_THAT(assertion, IsOk());

std::vector<std::string> components = absl::StrSplit(*assertion, '.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TEST(SelfSigningServiceAccountCredentials, CreateBearerToken) {
auto const info = SelfSigningServiceAccountCredentialsInfo{
/*.client_email*/ "--invalid--@developer.gserviceaccount.com",
/*.private_key_id*/ "test-private-key-id",
/*.private_key*/ testing::kWellFormatedKey,
/*.private_key*/ testing::kWellFormattedKey,
/*.audience*/ "https://storage.googleapis.com",
};
auto const now = std::chrono::system_clock::now();
Expand Down Expand Up @@ -75,7 +75,7 @@ TEST(SelfSigningServiceAccountCredentials, Basic) {
auto const info = SelfSigningServiceAccountCredentialsInfo{
/*.client_email*/ "--invalid--@developer.gserviceaccount.com",
/*.private_key_id*/ "test-private-key-id",
/*.private_key*/ testing::kWellFormatedKey,
/*.private_key*/ testing::kWellFormattedKey,
/*.audience*/ "test-audience",
};
auto actual = std::make_shared<SelfSigningServiceAccountCredentials>(info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ TEST_F(UnifiedRestCredentialsTest, LoadSuccess) {
{"type", "service_account"},
{"project_id", "invalid-test-only-project"},
{"private_key_id", kKeyId},
{"private_key", google::cloud::storage::testing::kWellFormatedKey},
{"private_key", google::cloud::storage::testing::kWellFormattedKey},
{"client_email", kClientEmail},
{"client_id", "invalid-test-only-client-id"},
{"auth_uri", "https://accounts.google.com/o/oauth2/auth"},
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/parallel_upload.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class NonResumableParallelUploadState {
* destructor, but if they fail, they fail silently. In order to proactively
* cleanup these files, one can call `EagerCleanup()`.
*
* In oder to resume an interrupted upload, provide `UseResumableUploadSession`
* In order to resume an interrupted upload, provide `UseResumableUploadSession`
* to `PrepareParallelUpload` with value set to what `resumable_session_id()`
* returns.
*/
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/parallel_uploads_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ TEST(ParallelUploadPersistentState, NotJson) {
StatusIs(StatusCode::kInternal, HasSubstr("not a valid JSON")));
}

TEST(ParallelUploadPersistentState, RootNotOject) {
TEST(ParallelUploadPersistentState, RootNotObject) {
auto res = ParallelUploadPersistentState::FromString("\"blah\"");
EXPECT_THAT(res,
StatusIs(StatusCode::kInternal, HasSubstr("not a JSON object")));
Expand Down
24 changes: 12 additions & 12 deletions google/cloud/storage/storage_iam_policy_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {

static_assert(std::is_copy_constructible<NativeExpression>::value,
"NativeExpression shoud be copy constructible");
"NativeExpression should be copy constructible");
static_assert(std::is_move_constructible<NativeExpression>::value,
"NativeExpression shoud be move constructible");
"NativeExpression should be move constructible");
static_assert(std::is_copy_assignable<NativeExpression>::value,
"NativeExpression shoud be copy assignable");
"NativeExpression should be copy assignable");
static_assert(std::is_move_assignable<NativeExpression>::value,
"NativeExpression shoud be move assignable");
"NativeExpression should be move assignable");

static_assert(std::is_copy_constructible<NativeIamBinding>::value,
"NativeIamBinding shoud be copy constructible");
"NativeIamBinding should be copy constructible");
static_assert(std::is_move_constructible<NativeIamBinding>::value,
"NativeIamBinding shoud be move constructible");
"NativeIamBinding should be move constructible");
static_assert(std::is_copy_assignable<NativeIamBinding>::value,
"NativeIamBinding shoud be copy assignable");
"NativeIamBinding should be copy assignable");
static_assert(std::is_move_assignable<NativeIamBinding>::value,
"NativeIamBinding shoud be move assignable");
"NativeIamBinding should be move assignable");

static_assert(std::is_copy_constructible<NativeIamPolicy>::value,
"NativeIamPolicy shoud be copy constructible");
"NativeIamPolicy should be copy constructible");
static_assert(std::is_move_constructible<NativeIamPolicy>::value,
"NativeIamPolicy shoud be move constructible");
"NativeIamPolicy should be move constructible");
static_assert(std::is_copy_assignable<NativeIamPolicy>::value,
"NativeIamPolicy shoud be copy assignable");
"NativeIamPolicy should be copy assignable");
static_assert(std::is_move_assignable<NativeIamPolicy>::value,
"NativeIamPolicy shoud be move assignable");
"NativeIamPolicy should be move assignable");

TEST(NativeIamExpression, CtorAndAccessors) {
NativeExpression expr("expr", "title", "descr", "loc");
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/testing/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ char const kP12KeyFileContents[] =

// This is an invalidated private key. It was created using the Google Cloud
// Platform console, but then the key (and service account) were deleted.
auto constexpr kWellFormatedKey = R"""(-----BEGIN PRIVATE KEY-----
auto constexpr kWellFormattedKey = R"""(-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCltiF2oP3KJJ+S
tTc1McylY+TuAi3AdohX7mmqIjd8a3eBYDHs7FlnUrFC4CRijCr0rUqYfg2pmk4a
6TaKbQRAhWDJ7XD931g7EBvCtd8+JQBNWVKnP9ByJUaO0hWVniM50KTsWtyX3up/
Expand Down
12 changes: 6 additions & 6 deletions google/cloud/storage/tests/signed_url_conformance_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ TEST_P(V4SignedUrlConformanceTest, V4SignJson) {
AddQueryParameterOption(name_val.first, name_val.second);
}

VirtualHostname virtual_hotname;
VirtualHostname virtual_hostname;
if (url_style == UrlStyle::VIRTUAL_HOSTED_STYLE) {
virtual_hotname = VirtualHostname(true);
virtual_hostname = VirtualHostname(true);
request.set_multiple_options(VirtualHostname(true));
}

Expand All @@ -147,7 +147,7 @@ TEST_P(V4SignedUrlConformanceTest, V4SignJson) {
SignedUrlDuration(valid_for), header_extensions[0], header_extensions[1],
header_extensions[2], header_extensions[3], header_extensions[4],
query_params[0], query_params[1], query_params[2], query_params[3],
query_params[4], virtual_hotname, domain_named_bucket, Scheme(scheme));
query_params[4], virtual_hostname, domain_named_bucket, Scheme(scheme));
ASSERT_STATUS_OK(request.Validate());
request.AddMissingRequiredHeaders();
ASSERT_STATUS_OK(request.Validate());
Expand Down Expand Up @@ -198,9 +198,9 @@ TEST_P(V4PostPolicyConformanceTest, V4PostPolicy) {
if (url_style == UrlStyle::BUCKET_BOUND_HOSTNAME) {
domain_named_bucket = BucketBoundHostname(input.bucketboundhostname());
}
VirtualHostname virtual_hotname;
VirtualHostname virtual_hostname;
if (url_style == UrlStyle::VIRTUAL_HOSTED_STYLE) {
virtual_hotname = VirtualHostname(true);
virtual_hostname = VirtualHostname(true);
}

std::vector<PolicyDocumentCondition> conditions;
Expand Down Expand Up @@ -246,7 +246,7 @@ TEST_P(V4PostPolicyConformanceTest, V4PostPolicy) {
auto doc_res = client.GenerateSignedPostPolicyV4(
doc, extension_fields[0], extension_fields[1], extension_fields[2],
extension_fields[3], extension_fields[4], Scheme(scheme),
domain_named_bucket, virtual_hotname);
domain_named_bucket, virtual_hostname);
ASSERT_STATUS_OK(doc_res);
EXPECT_EQ(expected_policy, doc_res->policy);
auto actual_policy_vec = internal::Base64Decode(doc_res->policy);
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/testing_util/contains_once_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ TEST(ContainsOnce, NoMatchOrMultipleMatches) {
EXPECT_THAT(v3, Not(ContainsOnce("foo")));
EXPECT_THAT(v3, Not(ContainsOnce("bar")));

std::vector<std::string> v4 = {"bar", "baz"};
EXPECT_THAT(v4, Not(ContainsOnce(AnyOf("bar", "baz"))));
std::vector<std::string> v4 = {"abc", "abd"};
EXPECT_THAT(v4, Not(ContainsOnce(AnyOf("abc", "abd"))));
EXPECT_THAT(v4, Not(ContainsOnce(HasSubstr("oo"))));
EXPECT_THAT(v4, Not(ContainsOnce(HasSubstr("ba"))));
EXPECT_THAT(v4, Not(ContainsOnce(HasSubstr("ab"))));
EXPECT_THAT(v4, Not(ContainsOnce(IsEmpty())));
EXPECT_THAT(v4, Not(ContainsOnce(Not(IsEmpty()))));
}
Expand Down

0 comments on commit edbe664

Please sign in to comment.