Skip to content

Commit bccf8c2

Browse files
committed
Sort before looking for first
1 parent 84ba3d8 commit bccf8c2

File tree

36 files changed

+96
-98
lines changed

36 files changed

+96
-98
lines changed

.tools/readmes/scanner.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,11 @@ def snippet(self, example: Example, readme_folder, api_name: str):
142142
excerpt = first(ex_ver.excerpts)
143143
if excerpt is not None:
144144
if excerpt.snippet_tags:
145-
tags = excerpt.snippet_tags
146-
tags = [*filter(lambda t: api_name in t, tags)]
147-
148-
# tags = [*sorted(tags)] # TODO: Switch to this form so that READMEs are always consistent
149-
tags = [*reversed(tags)]
150-
151-
tag = first(tags) or excerpt.snippet_tags[0]
145+
# This form ensures that READMEs are always consistent,
146+
# but does not always give the "best" README link.
147+
tags = [*sorted(excerpt.snippet_tags)]
148+
filtered = filter(lambda t: api_name in t, tags)
149+
tag = first(filtered) or tags[0]
152150
elif excerpt.snippet_files:
153151
# TODO: Find the best (or all?) snippet files, not the first.
154152
full_path = first(excerpt.snippet_files)

aws-cli/bash-linux/s3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Code excerpts that show you how to call individual service functions.
4747
- [DeleteObjects](bucket-lifecycle-operations/bucket_operations.sh#L303)
4848
- [GetObject](bucket-lifecycle-operations/bucket_operations.sh#L168)
4949
- [HeadBucket](bucket-lifecycle-operations/bucket_operations.sh#L20)
50-
- [ListObjectsV2](bucket-lifecycle-operations/awsdocs_general.sh#L94)
50+
- [ListObjectsV2](bucket-lifecycle-operations/bucket_operations.sh#L236)
5151
- [PutObject](bucket-lifecycle-operations/bucket_operations.sh#L134)
5252

5353

cpp/example_code/aurora/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Code excerpts that show you how to call individual service functions.
6060
- [DeleteDBCluster](getting_started_with_db_clusters.cpp#L1047)
6161
- [DeleteDBClusterParameterGroup](getting_started_with_db_clusters.cpp#L1117)
6262
- [DeleteDBInstance](getting_started_with_db_clusters.cpp#L1017)
63-
- [DescribeDBClusterParameterGroups](getting_started_with_db_clusters.cpp#L295)
63+
- [DescribeDBClusterParameterGroups](getting_started_with_db_clusters.cpp#L276)
6464
- [DescribeDBClusterParameters](getting_started_with_db_clusters.cpp#L786)
6565
- [DescribeDBClusterSnapshots](getting_started_with_db_clusters.cpp#L701)
6666
- [DescribeDBClusters](getting_started_with_db_clusters.cpp#L746)

cpp/example_code/dynamodb/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Next, for information on code example structures and how to build and run the ex
4646

4747
Code examples that show you how to perform the essential operations within a service.
4848

49-
- [Learn the basics](dynamodb_utils.cpp)
49+
- [Learn the basics](dynamodb_getting_started_scenario.cpp)
5050

5151

5252
### Single actions
@@ -74,8 +74,8 @@ Code examples that show you how to accomplish a specific task by calling multipl
7474
functions within the same service.
7575

7676
- [Create a serverless application to manage photos](../../example_code/cross-service/photo_asset_manager)
77-
- [Query a table by using batches of PartiQL statements](dynamodb_utils.cpp)
78-
- [Query a table using PartiQL](dynamodb_utils.cpp)
77+
- [Query a table by using batches of PartiQL statements](dynamodb_partiql_batch_scenario.cpp)
78+
- [Query a table using PartiQL](dynamodb_partiql_single_scenario.cpp)
7979

8080

8181
<!--custom.examples.start-->

cpp/example_code/ec2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Next, for information on code example structures and how to build and run the ex
4646

4747
Code excerpts that show you how to call individual service functions.
4848

49-
- [AllocateAddress](allocate_address.cpp#L73)
49+
- [AllocateAddress](allocate_address.cpp#L23)
5050
- [AssociateAddress](associate_address.cpp#L20)
5151
- [AuthorizeSecurityGroupIngress](authorize_security_group_ingress.cpp#L26)
5252
- [CreateKeyPair](create_key_pair.cpp#L23)

cpp/example_code/iam/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Code excerpts that show you how to call individual service functions.
4949
- [AttachRolePolicy](attach_role_policy.cpp#L38)
5050
- [CreateAccessKey](create_access_key.cpp#L35)
5151
- [CreateAccountAlias](create_account_alias.cpp#L35)
52-
- [CreatePolicy](create_policy.cpp#L43)
52+
- [CreatePolicy](create_policy.cpp#L69)
5353
- [CreateRole](create_role.cpp#L35)
5454
- [CreateUser](create_user.cpp#L40)
5555
- [DeleteAccessKey](delete_access_key.cpp#L35)

cpp/example_code/rds/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Code excerpts that show you how to call individual service functions.
6060
- [DeleteDBParameterGroup](getting_started_with_db_instances.cpp#L927)
6161
- [DescribeDBEngineVersions](getting_started_with_db_instances.cpp#L698)
6262
- [DescribeDBInstances](getting_started_with_db_instances.cpp#L752)
63-
- [DescribeDBParameterGroups](getting_started_with_db_instances.cpp#L275)
63+
- [DescribeDBParameterGroups](getting_started_with_db_instances.cpp#L256)
6464
- [DescribeDBParameters](getting_started_with_db_instances.cpp#L639)
6565
- [DescribeDBSnapshots](getting_started_with_db_instances.cpp#L597)
6666
- [DescribeOrderableDBInstanceOptions](getting_started_with_db_instances.cpp#L792)

cpp/example_code/s3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Code excerpts that show you how to call individual service functions.
7272
- [ListBuckets](list_buckets.cpp#L29)
7373
- [ListObjectsV2](list_objects.cpp#L32)
7474
- [PutBucketAcl](put_bucket_acl.cpp#L47)
75-
- [PutBucketPolicy](put_bucket_policy.cpp#L37)
75+
- [PutBucketPolicy](put_bucket_policy.cpp#L68)
7676
- [PutBucketWebsite](put_website_config.cpp#L33)
7777
- [PutObject](put_object.cpp#L33)
7878
- [PutObjectAcl](get_put_object_acl.cpp#L165)

cpp/example_code/sqs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Code excerpts that show you how to call individual service functions.
5151
- [DeleteMessage](delete_message.cpp#L23)
5252
- [DeleteMessageBatch](../cross-service/topics_and_queues/messaging_with_topics_and_queues.cpp#L644)
5353
- [DeleteQueue](delete_queue.cpp#L24)
54-
- [GetQueueAttributes](../cross-service/topics_and_queues/messaging_with_topics_and_queues.cpp#L380)
54+
- [GetQueueAttributes](../cross-service/topics_and_queues/messaging_with_topics_and_queues.cpp#L332)
5555
- [GetQueueUrl](get_queue_url.cpp#L23)
5656
- [ListQueues](list_queues.cpp#L23)
5757
- [ReceiveMessage](receive_message.cpp#L23)

dotnetv3/AutoScaling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `dotnetv3
3838

3939
Code examples that show you how to perform the essential operations within a service.
4040

41-
- [Learn the basics](Scenarios/AutoScalingBasics/UIWrapper.cs)
41+
- [Learn the basics](Scenarios/AutoScalingBasics/AutoScalingBasics.cs)
4242

4343

4444
### Single actions

0 commit comments

Comments
 (0)