Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bullet lists in docstrings should end with blank lines #604

Closed
busunkim96 opened this issue Sep 17, 2020 · 3 comments · Fixed by #714
Closed

Bullet lists in docstrings should end with blank lines #604

busunkim96 opened this issue Sep 17, 2020 · 3 comments · Fixed by #714
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API.

Comments

@busunkim96
Copy link
Contributor

busunkim96 commented Sep 17, 2020

// Request for the
// [CreateWorkflow][google.cloud.workflows.v1beta.Workflows.CreateWorkflow]
// method.
message CreateWorkflowRequest {
  // Required. Project and location in which the workflow should be created.
  // Format:  projects/{project}/locations/{location}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // Required. Workflow to be created.
  Workflow workflow = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The ID of the workflow to be created. It has to fulfill the
  // following requirements:
  //
  // * Must contain only letters, numbers, underscores and hyphens.
  // * Must start with a letter.
  // * Must be between 1-64 characters.
  // * Must end with a number or a letter.
  // * Must be unique within the customer project and location.
  string workflow_id = 3 [(google.api.field_behavior) = REQUIRED];
}

Gets turned into

            workflow_id (:class:`str`):
                Required. The ID of the workflow to be created. It has
                to fulfill the following requirements:

                -  Must contain only letters, numbers, underscores and
                   hyphens.
                -  Must start with a letter.
                -  Must be between 1-64 characters.
                -  Must end with a number or a letter.
                -  Must be unique within the customer project and
                   location.
                This corresponds to the ``workflow_id`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.

Which results in a Sphinx warning

WARNING: Bullet list ends without a blank line; unexpected unindent.
@busunkim96 busunkim96 added type: docs Improvement to the documentation for an API. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Sep 17, 2020
@software-dov software-dov changed the title Bullet lists in docstrings should end with black lines Bullet lists in docstrings should end with blank lines Sep 18, 2020
@larkee
Copy link

larkee commented Oct 2, 2020

I am also encountering this in the Spanner library:

// The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
message UpdateBackupRequest {
  // Required. The backup to update. `backup.name`, and the fields to be updated
  // as specified by `update_mask` are required. Other fields are ignored.
  // Update is only supported for the following fields:
  //  * `backup.expire_time`.
  Backup backup = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. A mask specifying which fields (e.g. `expire_time`) in the
  // Backup resource should be updated. This mask is relative to the Backup
  // resource, not to the request message. The field mask must always be
  // specified; this prevents any future fields from being erased accidentally
  // by clients that do not know about them.
  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}

becomes

            backup (:class:`~.gsad_backup.Backup`):
                Required. The backup to update. ``backup.name``, and the
                fields to be updated as specified by ``update_mask`` are
                required. Other fields are ignored. Update is only
                supported for the following fields:

                -  ``backup.expire_time``.
                This corresponds to the ``backup`` field
                on the ``request`` instance; if ``request`` is provided, this
                should not be set.

@tswast
Copy link

tswast commented Oct 29, 2020

Happened here, too: googleapis/python-bigquery-reservation#47

Source protos do not include "This corresponds to ...", so this is probably caused by the templates in the generator.

https://github.com/googleapis/googleapis/blob/ab0498dc4bd2bcfcb70ab257e8edfa00f86083a6/google/cloud/bigquery/reservation/v1/reservation.proto#L785-L792

@tswast
Copy link

tswast commented Oct 29, 2020

Maybe as simple as removing the nl=False from these templates?

busunkim96 added a commit that referenced this issue Dec 22, 2020
Cross-references like `~.ImageAnnotatorClient` don't always work correctly with sphinx. This PR changes the `sphinx()` method to always produce a full path like `google.cloud.vision_v1.ImageAnnotatorClient`. 

Also some other smaller changes:
- Generate a separate `.rst` page for each service, which improves readability for APIs that have (1) a lot of services or (2) a lot of methods in a service. `services.rst` acts as an index page instead.
- Add pagers to the generated docs
- Use `undoc-members` to list enum attributes in generated docs (fixes #625) 
- Add newlines after bulleted lists by removing `nl=False`. Fixes #604 
- Add a 'docs' session to the templated `noxfile.py` so folks using the self-service model can have generated docs.
- Fix reference to LRO result type in `Returns:`
- Fix `{@api.name}` reference in the `from_service_account..`. methods  to reference the client type instead
- Remove `:class:` notation when specifying types for attributes (sphinx doesn't need it to create a link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants