Skip to content

Commit 7be3a55

Browse files
authored
docs: fix minor typos (#2318)
1 parent 153b346 commit 7be3a55

File tree

11 files changed

+38
-38
lines changed

11 files changed

+38
-38
lines changed

gapic/configurable_snippetgen/snippet_config_language.proto

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ message SnippetSignature {
167167

168168
// Languages that support both async and sync methods should generate both a
169169
// sync and an async snippets. Note that different samples should be in
170-
// differnt files.
170+
// different files.
171171
// Languages that support only one of async and sync methods should
172172
// generate the supported snippet.
173173
BOTH = 3;
@@ -494,7 +494,7 @@ message Snippet {
494494
// Describes how to handle LRO responses.
495495
message LroResponseHandling {
496496
// The name of the variable to capture the LRO response in. Required.
497-
// This will capture the response to the LRO operaion call and not to
497+
// This will capture the response to the LRO operation call and not to
498498
// polling operations.
499499
string response_name = 1;
500500

@@ -556,7 +556,7 @@ message Statement {
556556
// An iteration statement. A given Statement set will be executed
557557
// repeatedly according to the iteration definition.
558558
// Each iteration type will make a per-step Expression.NameValue set
559-
// available that may be used withing the given Statement set.
559+
// available that may be used within the given Statement set.
560560
Iteration iteration = 5;
561561
}
562562

@@ -617,7 +617,7 @@ message Statement {
617617
// An iteration statement. A given Statement set will be executed
618618
// repeatedly according to the iteration definition.
619619
// Each iteration type will make a per-step Expression.NameValue set
620-
// available that may be used withing the given Statement set.
620+
// available that may be used within the given Statement set.
621621
message Iteration {
622622
oneof iteration_type {
623623
// A numeric sequence iteration.
@@ -642,7 +642,7 @@ message Statement {
642642
// Represents a numeric sequence iteration.
643643
// A numeric sequence is defined over which to iterate making the current
644644
// element of the sequence available in a variable.
645-
// It's ultimately the responsability of the user to define a finite
645+
// It's ultimately the responsibility of the user to define a finite
646646
// sequence, although tooling may be provided to help.
647647
message NumericSequenceIteration {
648648
// Where to start the sequence at, ie. the first element of the iteration.
@@ -740,7 +740,7 @@ message Statement {
740740

741741
// How to split the byte sequence in chunks to iterate over.
742742
oneof chunk {
743-
// The size of the chuncks to split the byte sequence in. The last chunk
743+
// The size of the chunks to split the byte sequence in. The last chunk
744744
// will be at most chunk_size. Must be positive.
745745
// Should resolve to an integer type.
746746
Expression chunk_size = 2;
@@ -1010,7 +1010,7 @@ message Expression {
10101010
// and a Declaration of
10111011
// - Declaration.type => SampleMessage and
10121012
// - Declaration.name => sample_value
1013-
// then posible NameValues that refer to the variable declared are:
1013+
// then possible NameValues that refer to the variable declared are:
10141014
// - NameValue.name => sample_value and NameValue.path => unset to reference
10151015
// the value of the sample_value variable, i.e. using the variable
10161016
// sample_value

gapic/configurable_snippetgen/snippet_config_language_pb2.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class SnippetSignature(google.protobuf.message.Message):
243243
BOTH: SnippetSignature._SyncPreference.ValueType # 3
244244
"""Languages that support both async and sync methods should generate both a
245245
sync and an async snippets. Note that different samples should be in
246-
differnt files.
246+
different files.
247247
Languages that support only one of async and sync methods should
248248
generate the supported snippet.
249249
"""
@@ -271,7 +271,7 @@ class SnippetSignature(google.protobuf.message.Message):
271271
BOTH: SnippetSignature.SyncPreference.ValueType # 3
272272
"""Languages that support both async and sync methods should generate both a
273273
sync and an async snippets. Note that different samples should be in
274-
differnt files.
274+
different files.
275275
Languages that support only one of async and sync methods should
276276
generate the supported snippet.
277277
"""
@@ -919,7 +919,7 @@ class Snippet(google.protobuf.message.Message):
919919
POLLING_CALL_FIELD_NUMBER: builtins.int
920920
response_name: builtins.str
921921
"""The name of the variable to capture the LRO response in. Required.
922-
This will capture the response to the LRO operaion call and not to
922+
This will capture the response to the LRO operation call and not to
923923
polling operations.
924924
"""
925925
polling_type: global___Snippet.LroResponseHandling.PollingType.ValueType
@@ -1154,7 +1154,7 @@ class Statement(google.protobuf.message.Message):
11541154
"""An iteration statement. A given Statement set will be executed
11551155
repeatedly according to the iteration definition.
11561156
Each iteration type will make a per-step Expression.NameValue set
1157-
available that may be used withing the given Statement set.
1157+
available that may be used within the given Statement set.
11581158
"""
11591159

11601160
DESCRIPTOR: google.protobuf.descriptor.Descriptor
@@ -1164,7 +1164,7 @@ class Statement(google.protobuf.message.Message):
11641164
"""Represents a numeric sequence iteration.
11651165
A numeric sequence is defined over which to iterate making the current
11661166
element of the sequence available in a variable.
1167-
It's ultimately the responsability of the user to define a finite
1167+
It's ultimately the responsibility of the user to define a finite
11681168
sequence, although tooling may be provided to help.
11691169
"""
11701170

@@ -1336,7 +1336,7 @@ class Statement(google.protobuf.message.Message):
13361336
"""
13371337
@property
13381338
def chunk_size(self) -> global___Expression:
1339-
"""The size of the chuncks to split the byte sequence in. The last chunk
1339+
"""The size of the chunks to split the byte sequence in. The last chunk
13401340
will be at most chunk_size. Must be positive.
13411341
Should resolve to an integer type.
13421342
"""
@@ -1432,7 +1432,7 @@ class Statement(google.protobuf.message.Message):
14321432
"""An iteration statement. A given Statement set will be executed
14331433
repeatedly according to the iteration definition.
14341434
Each iteration type will make a per-step Expression.NameValue set
1435-
available that may be used withing the given Statement set.
1435+
available that may be used within the given Statement set.
14361436
"""
14371437
def __init__(
14381438
self,
@@ -1814,7 +1814,7 @@ class Expression(google.protobuf.message.Message):
18141814
and a Declaration of
18151815
- Declaration.type => SampleMessage and
18161816
- Declaration.name => sample_value
1817-
then posible NameValues that refer to the variable declared are:
1817+
then possible NameValues that refer to the variable declared are:
18181818
- NameValue.name => sample_value and NameValue.path => unset to reference
18191819
the value of the sample_value variable, i.e. using the variable
18201820
sample_value

gapic/samplegen/samplegen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def preprocess_sample(sample, api_schema: api.API, rpc: wrappers.Method):
302302
is_async = transport == api.TRANSPORT_GRPC_ASYNC
303303
sample["client_name"] = service.async_client_name if is_async else service.client_name
304304

305-
# the MessageType of the request object passed to the rpc e.g, `ListRequest`
305+
# the MessageType of the request object passed to the rpc e.g., `ListRequest`
306306
sample["request_type"] = rpc.input
307307

308308
# We check if the request object is part of the service proto package.
@@ -744,7 +744,7 @@ def _validate_format(self, body: List[str]):
744744
num_prints = fmt_str.count("%s")
745745
if num_prints != len(body) - 1:
746746
raise types.MismatchedFormatSpecifier(
747-
"Expected {} expresssions in format string '{}' but found {}".format(
747+
"Expected {} expressions in format string '{}' but found {}".format(
748748
num_prints, fmt_str, len(body) - 1
749749
)
750750
)
@@ -821,7 +821,7 @@ def _validate_loop(self, loop):
821821
Checks for correctly defined loop constructs,
822822
either 'collection' loops with a collection and iteration variable,
823823
or 'map' loops with a map and at least one of 'key' or 'value'.
824-
Loops also have a 'body', which contains statments that may
824+
Loops also have a 'body', which contains statements that may
825825
use the variables from the header.
826826
827827
The body statements are validated recursively.

gapic/samplegen_utils/snippet_metadata.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ message Snippet {
6161
// may be written in F# or VB .NET.
6262
// Note that this does not contain information about the snippet supported
6363
// platforms or language versions, etc. This is just a quick way to identify
64-
// the generally supported langauge.
64+
// the generally supported language.
6565
Language language = 5;
6666

6767
// The client library method this snippet is for.
6868
ClientMethod client_method = 6;
6969

70-
// Wether this is the canonical snippet for the corresponding service method.
70+
// Whether this is the canonical snippet for the corresponding service method.
7171
// This is to be interpreted in conjunction with origin as follows:
7272
// For a given service method:
7373
// - A handwritten canonical takes precedence over
@@ -128,7 +128,7 @@ message Snippet {
128128
FULL = 1;
129129

130130
// A shorter version of the full sample, may not include imports and some
131-
// langauge specific initialization code. This is to be used in contexts
131+
// language specific initialization code. This is to be used in contexts
132132
// in which the full aspects of the sample are made clear outside the
133133
// code.
134134
SHORT = 2;
@@ -166,7 +166,7 @@ message ClientMethod {
166166
// This may not be unique within the service client because of overloads.
167167
string full_name = 2;
168168

169-
// Indicates wether this method is synchronous or asynchronous.
169+
// Indicates whether this method is synchronous or asynchronous.
170170
// Some languages may support only one of the variants, in which case, this
171171
// field will always have the same value (for that language).
172172
bool async = 3;
@@ -205,7 +205,7 @@ message ServiceClient {
205205

206206
// The fully qualified name of the service client, which is the short_name
207207
// qualified by the namespace/package/type name this client is declared in.
208-
// This will be unique within the client libray.
208+
// This will be unique within the client library.
209209
string full_name = 2;
210210
}
211211

@@ -228,7 +228,7 @@ message ClientLibrary {
228228
// The programming language the library is written in.
229229
// Note that this does not contain information about the library supported
230230
// platforms or language versions, etc. This is just a quick way to identify
231-
// the generally supported langauge.
231+
// the generally supported language.
232232
Language language = 3;
233233

234234
// The APIs this client library is for.

gapic/schema/naming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Naming(abc.ABC):
3434
This class contains the naming nomenclature used for this API
3535
within templates.
3636
37-
An concrete child of this object is made available to every template
37+
A concrete child of this object is made available to every template
3838
(as ``api.naming``).
3939
"""
4040
name: str = ''

gapic/schema/wrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def inner_mock(self, stack, visited_fields) -> str:
218218
answer = f'{self.type.ident}({sub.name}={{}})'
219219

220220
if self.map:
221-
# Maps are a special case beacuse they're represented internally as
221+
# Maps are a special case because they're represented internally as
222222
# a list of a generated type with two fields: 'key' and 'value'.
223223
answer = '{{{}: {}}}'.format(
224224
self.type.fields["key"].mock_value,

tests/unit/samplegen/test_snippet_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_snippet_init(sample_str):
8080

8181
# This is the same as the sample_str above, minus the # [START ...]
8282
# and # [END ...] lines
83-
expected_full_snipppet = """from molluscs.v1 import molluscclient
83+
expected_full_snippet = """from molluscs.v1 import molluscclient
8484
8585
8686
def sample_classify(video, location):
@@ -109,7 +109,7 @@ def sample_classify(video, location):
109109
110110
"""
111111

112-
assert snippet.full_snippet == expected_full_snipppet
112+
assert snippet.full_snippet == expected_full_snippet
113113

114114

115115
def test_add_snippet_no_matching_service(sample_str):

tests/unit/schema/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,7 +3482,7 @@ def make_initiate_options(service_name):
34823482
make_message_pb2(name='CreateBarRequest'),
34833483
make_message_pb2(name='GetBarOperationRequest'),
34843484
make_message_pb2(name='PoorlyOrganizedMethodRequest'),
3485-
make_message_pb2(name='PoorlyOrganizedMethodReponse')
3485+
make_message_pb2(name='PoorlyOrganizedMethodResponse')
34863486
),
34873487
services=(
34883488
descriptor_pb2.ServiceDescriptorProto(
@@ -3497,7 +3497,7 @@ def make_initiate_options(service_name):
34973497
descriptor_pb2.MethodDescriptorProto(
34983498
name='PoorlyOrganizedMethod',
34993499
input_type='google.example.v1.PoorlyOrganizedMethodRequest',
3500-
output_type='google.example.v1.PoorlyOrganizedMethodReponse',
3500+
output_type='google.example.v1.PoorlyOrganizedMethodResponse',
35013501
),
35023502
),
35033503
),

tests/unit/schema/wrappers/test_message.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_get_field_recursive():
151151
outer_field = make_field('inner', message=inner)
152152
outer = make_message('Outer', fields=(outer_field,))
153153

154-
# Assert that a recusive retrieval works.
154+
# Assert that a recursive retrieval works.
155155
assert outer.get_field('inner', 'zero') == inner_fields[0]
156156
assert outer.get_field('inner', 'one') == inner_fields[1]
157157
assert outer.get_field('inner.one') == inner_fields[1]
@@ -166,7 +166,7 @@ def test_get_field_nested_not_found_error():
166166
outer_field = make_field('inner', message=inner)
167167
outer = make_message('Outer', fields=(outer_field,))
168168

169-
# Assert that a recusive retrieval fails.
169+
# Assert that a recursive retrieval fails.
170170
with pytest.raises(KeyError):
171171
assert outer.get_field('inner', 'zero', 'beyond')
172172

@@ -180,7 +180,7 @@ def test_get_field_nonterminal_repeated_error():
180180
outer_field = make_field('inner', message=inner, repeated=True)
181181
outer = make_message('Outer', fields=(outer_field,))
182182

183-
# Assert that a recusive retrieval fails.
183+
# Assert that a recursive retrieval fails.
184184
with pytest.raises(KeyError):
185185
assert outer.get_field('inner', 'zero') == inner_fields[0]
186186
with pytest.raises(KeyError):
@@ -309,7 +309,7 @@ def test_oneof_fields():
309309
length_f = make_field(name="length_f", oneof="length", type=5)
310310
color = make_field(name="color", type=5)
311311
request = make_message(
312-
name="CreateMolluscReuqest",
312+
name="CreateMolluscRequest",
313313
fields=(
314314
mass_kg,
315315
mass_lbs,
@@ -345,7 +345,7 @@ def test_required_fields():
345345
)
346346

347347
request = make_message(
348-
name="CreateMolluscReuqest",
348+
name="CreateMolluscRequest",
349349
fields=(
350350
mass_kg,
351351
length_m,

tests/unit/schema/wrappers/test_method.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ def test_flattened_oneof_fields():
801801
),
802802
)
803803
request = make_message(
804-
name="CreateMolluscReuqest",
804+
name="CreateMolluscRequest",
805805
fields=(
806806
length_m,
807807
length_f,
@@ -825,7 +825,7 @@ def test_flattened_oneof_fields():
825825
actual = method.flattened_oneof_fields()
826826
assert expected == actual
827827

828-
# Check this method too becasue the setup is a lot of work.
828+
# Check this method too because the setup is a lot of work.
829829
expected = {
830830
"color": "color",
831831
"length_m": "length_m",

0 commit comments

Comments
 (0)