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

Update documentation according to Effective Dart documentation guide #664

Merged
merged 5 commits into from Jun 8, 2022

Conversation

osa1
Copy link
Member

@osa1 osa1 commented May 31, 2022

Effective Dart documentation section:
https://dart.dev/guides/language/effective-dart/documentation

This addresses reviews in cl/449413572 about the documentation in this library.

Summary of changes:

  • Use noun phrases in getters, fields

  • Replace [:...:] syntax with ``

  • Use [...] syntax for in-scope identifiers in comments and documentation

  • Use "create" instead of "return" for methods that create a new instance
    (rather than returning an existing one)

  • Give a single sentence summary in API docs, move the rest to new paragraph(s)

  • When documentation exception behavior, start the sentence with "Throws" in a
    new paragraph. Similarly when documenting return values do the same, starting
    with "Returns".

  • Some rewording

  • Use ArgumentError.value constructor in some cases (instead of
    ArgumentError)

Note that I did not review every line of comment/doc in the library to update
them according to the Effective Dart guidelines. This only addresses reviews
that came up in cl/449413572.


@lrhn Could you review please? (GitHub doesn't let me add you as a reviewer)

@osa1 osa1 requested a review from sigurdm May 31, 2022 11:45
@osa1 osa1 marked this pull request as ready for review May 31, 2022 11:45
Copy link
Collaborator

@sigurdm sigurdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

LGTM

protobuf/lib/src/protobuf/generated_message.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@lrhn lrhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, few nits.

protobuf/lib/src/protobuf/builder_info.dart Outdated Show resolved Hide resolved
protobuf/lib/src/protobuf/field_info.dart Outdated Show resolved Hide resolved
protobuf/lib/src/protobuf/generated_message.dart Outdated Show resolved Hide resolved
protobuf/lib/src/protobuf/generated_message.dart Outdated Show resolved Hide resolved
protoc_plugin/lib/src/protobuf_field.dart Outdated Show resolved Hide resolved
protoc_plugin/lib/src/protobuf_field.dart Outdated Show resolved Hide resolved
protoc_plugin/test/json_test.dart Outdated Show resolved Hide resolved
@osa1 osa1 merged commit 408f69b into google:master Jun 8, 2022
@osa1 osa1 deleted the docs branch June 8, 2022 08:33
osa1 added a commit to osa1/protobuf.dart that referenced this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants