Skip to content

Commit

Permalink
fix: use jsdoc link syntax (#316)
Browse files Browse the repository at this point in the history
* fix: use jsdoc link syntax

* add global flag in regex

* run baselin test

* readable name

* format the method comment

* continue format
  • Loading branch information
alexander-fenster committed Mar 5, 2020
1 parent e716513 commit b0b280f
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 161 deletions.
294 changes: 147 additions & 147 deletions baselines/kms/src/v1/key_management_service_client.ts.baseline

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export class AlertPolicyServiceClient {
*
* projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]
*
* For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
* For more information, see {@link google.monitoring.v3.AlertPolicy|AlertPolicy}.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
Expand Down Expand Up @@ -638,7 +638,7 @@ export class AlertPolicyServiceClient {
* Note that this field names the parent container in which the alerting
* policies to be listed are stored. To retrieve a single alerting policy
* by name, use the
* [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy]
* {@link google.monitoring.v3.AlertPolicyService.GetAlertPolicy|GetAlertPolicy}
* operation, instead.
* @param {string} request.filter
* If provided, this field specifies the criteria that must be met by
Expand Down Expand Up @@ -735,7 +735,7 @@ export class AlertPolicyServiceClient {
* Note that this field names the parent container in which the alerting
* policies to be listed are stored. To retrieve a single alerting policy
* by name, use the
* [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy]
* {@link google.monitoring.v3.AlertPolicyService.GetAlertPolicy|GetAlertPolicy}
* operation, instead.
* @param {string} request.filter
* If provided, this field specifies the criteria that must be met by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ export class NotificationChannelServiceClient {
*
* Note that this names the parent container in which to look for the
* descriptors; to retrieve a single descriptor by name, use the
* [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
* {@link google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor|GetNotificationChannelDescriptor}
* operation, instead.
* @param {number} request.pageSize
* The maximum number of results to return in a single response. If
Expand Down Expand Up @@ -983,7 +983,7 @@ export class NotificationChannelServiceClient {
*
* Note that this names the parent container in which to look for the
* descriptors; to retrieve a single descriptor by name, use the
* [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
* {@link google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor|GetNotificationChannelDescriptor}
* operation, instead.
* @param {number} request.pageSize
* The maximum number of results to return in a single response. If
Expand Down Expand Up @@ -1044,7 +1044,7 @@ export class NotificationChannelServiceClient {
* in which to look for the notification channels; it does not name a
* specific channel. To query a specific channel by REST resource name, use
* the
* [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
* {@link google.monitoring.v3.NotificationChannelService.GetNotificationChannel|`GetNotificationChannel`}
* operation.
* @param {string} request.filter
* If provided, this field specifies the criteria that must be met by
Expand Down Expand Up @@ -1141,7 +1141,7 @@ export class NotificationChannelServiceClient {
* in which to look for the notification channels; it does not name a
* specific channel. To query a specific channel by REST resource name, use
* the
* [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
* {@link google.monitoring.v3.NotificationChannelService.GetNotificationChannel|`GetNotificationChannel`}
* operation.
* @param {string} request.filter
* If provided, this field specifies the criteria that must be met by
Expand Down
6 changes: 3 additions & 3 deletions baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export class CloudRedisClient {
* @param {google.protobuf.FieldMask} request.updateMask
* Required. Mask of fields to update. At least one path must be supplied in
* this field. The elements of the repeated paths field may only include these
* fields from [Instance][google.cloud.redis.v1beta1.Instance]:
* fields from {@link google.cloud.redis.v1beta1.Instance|Instance}:
*
* * `displayName`
* * `labels`
Expand Down Expand Up @@ -850,7 +850,7 @@ export class CloudRedisClient {
* If not specified, a default value of 1000 will be used by the service.
* Regardless of the page_size value, the response may include a partial list
* and a caller should only rely on response's
* [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
* {@link CloudRedis.ListInstancesResponse.next_page_token|next_page_token}
* to determine if there are more instances left to be queried.
* @param {string} request.pageToken
* The next_page_token value returned from a previous List request,
Expand Down Expand Up @@ -933,7 +933,7 @@ export class CloudRedisClient {
* If not specified, a default value of 1000 will be used by the service.
* Regardless of the page_size value, the response may include a partial list
* and a caller should only rely on response's
* [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
* {@link CloudRedis.ListInstancesResponse.next_page_token|next_page_token}
* to determine if there are more instances left to be queried.
* @param {string} request.pageToken
* The next_page_token value returned from a previous List request,
Expand Down
8 changes: 5 additions & 3 deletions templates/typescript_gapic/_util.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.
-#}

{% set markdownReferenceRegex = r/\[(.*?)\]\[(.*?)\]/g %}

{%- macro printComments(method, service) -%}
{{- printCommentsForMethod(method) }}
{{- printRequest(method) -}}
Expand All @@ -37,7 +39,7 @@ limitations under the License.
{% for line in lines %}
{%- set trimmed = line.replace(r/\s+$/, '') -%}
{%- if trimmed.length > 0 %}
* {{ trimmed.replaceAll('*/', '* /') | safe}}
* {{ trimmed.replaceAll('*/', '* /') | replace(markdownReferenceRegex, '{@link $2|$1}') | safe }}
{%- else %}
*
{%- endif %}
Expand All @@ -47,7 +49,7 @@ limitations under the License.
{%- macro printCommentsForMethod(method) -%}
{%- set lines = method.comments -%}
{% for line in lines %}
*{{ line.replaceAll('*/', '* /').replace(r/\s+$/, '') | safe}}
*{{ line.replaceAll('*/', '* /').replace(r/\s+$/, '') | replace(markdownReferenceRegex, '{@link $2|$1}') | safe }}
{%- endfor %}
{%- endmacro -%}

Expand Down Expand Up @@ -87,7 +89,7 @@ limitations under the License.
{%- for line in lines %}
{%- set trimmed = line.replace(r/\s+$/, '') -%}
{%- if trimmed.length > 0 %}
* {{ trimmed.replaceAll('*/', '* /') | safe}}
* {{ trimmed.replaceAll('*/', '* /') | replace(markdownReferenceRegex, '{@link $2|$1}') | safe }}
{%- else %}
*
{%- endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export class {{ service.name }}Client {
* Return a fully-qualified {{ template.name.toCamelCase() }} resource name string.
*
{%- for param in template.params %}
* @param {string} {{ param }}
* @param {string} {{ param | replace(regExp, '{@link $2|$1}') }}
{%- endfor %}
* @returns {string} Resource name string.
*/
Expand Down

0 comments on commit b0b280f

Please sign in to comment.