Skip to content

Comment for client function#469

Merged
Yang-33 merged 3 commits intoline:masterfrom
Yang-33:comment-for-client-function
Apr 8, 2025
Merged

Comment for client function#469
Yang-33 merged 3 commits intoline:masterfrom
Yang-33:comment-for-client-function

Conversation

@Yang-33
Copy link
Copy Markdown
Contributor

@Yang-33 Yang-33 commented Apr 4, 2025

This change adds comments for the functions that each client has for YARD and IDE purposes.

Since YARD seems to report errors if the comments are incorrect, This change also ensures that the command is executed in the CI job.

@Yang-33 Yang-33 force-pushed the comment-for-client-function branch 6 times, most recently from 63a50c6 to b28b2e4 Compare April 5, 2025 13:06
@Yang-33 Yang-33 self-assigned this Apr 5, 2025
@Yang-33 Yang-33 force-pushed the comment-for-client-function branch 2 times, most recently from d3d84bd to 65d787e Compare April 8, 2025 00:59
Comment on lines -59 to -61
{% if op.summary -%}
# @summary {{ op.summary }}
{% endif -%}
Copy link
Copy Markdown
Contributor Author

@Yang-33 Yang-33 Apr 8, 2025

Choose a reason for hiding this comment

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

@summary doesn't exist, and op.summary is rarely used. This change deletes this.

Comment on lines +288 to +289
# @param from [String] Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9
# @param to [String] End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +55 to +59
# @return [Array(String(nilable), Integer, Hash{String => String})] when HTTP status code is 200
# @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
# @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403
# @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409
# @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's somewhat redundant, but I thought it's better than nothing.

@Yang-33 Yang-33 force-pushed the comment-for-client-function branch from 65d787e to e0b8d1d Compare April 8, 2025 01:11
Yang-33 added 3 commits April 8, 2025 10:13
NO-ISSUE template

NO-ISSUE teamplte

NO-ISSUE template

NO-ISSUE template

NO-ISSUE template
NO-ISSUE gen

NO-ISSUE gen

NO-ISSUE gen

NO-ISSUE gen
@Yang-33 Yang-33 force-pushed the comment-for-client-function branch from e0b8d1d to de5d9b4 Compare April 8, 2025 01:14
end

# Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).
# This requests to <code>GET https://api.line.me/v2/bot/insight/demographic</code>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without the <code> or <tt> tags, YRAD fails to interpret brackets like { in parts of a URL, such as in https://hoge/{userId}. I tried several escapes and tags, but they didn't work. As a workaround, this change uses HTML tags to prevent { from being interpreted as part of a URL. Since <code>GET https://api.line.me/v2/bot/insight/demographic</code> is simply a comment directed at the user and the URL doesn't lead anywhere meaningful, I believe this solution is sufficient.

- run: bundle install
- run: bundle exec rubocop
- run: bundle exec rspec
- run: bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since some YARD errors can be detected this way, let's add it to the CI.

Comment thread CONTRIBUTING.md
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues).
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-ruby/pulls).

## Development
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(We should also address the OpenAPI code generator, but for this PR, it is considered out of scope.)

#
# @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array.
# @param limit Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100
# @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[type, nil] = nilable

https://rubydoc.info/gems/yard/file/docs/GettingStarted.md

Declaring Types

@Yang-33 Yang-33 marked this pull request as ready for review April 8, 2025 01:23
@Yang-33 Yang-33 enabled auto-merge April 8, 2025 01:23
@Yang-33 Yang-33 requested a review from a team April 8, 2025 01:23
@Yang-33 Yang-33 mentioned this pull request Apr 8, 2025
Copy link
Copy Markdown
Contributor

@mokuzon mokuzon left a comment

Choose a reason for hiding this comment

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

The @return type in *_with_http_info is wrong, please check!

# This requests to <code>GET https://api.line.me/v2/bot/insight/demographic</code>
#
# @see https://developers.line.biz/en/reference/messaging-api/#get-demographic
# @return [response body, response status code, and response headers]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an incorrect description of YARD.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was intentional. Currently, these are being packed into an Array, but it's not understandable unless you read the code, so I thought it should be commented.

@Yang-33 Yang-33 requested a review from mokuzon April 8, 2025 03:37
@Yang-33 Yang-33 added this pull request to the merge queue Apr 8, 2025
Merged via the queue into line:master with commit c19a73f Apr 8, 2025
6 checks passed
@Yang-33 Yang-33 deleted the comment-for-client-function branch April 8, 2025 03:41
github-merge-queue Bot pushed a commit that referenced this pull request Apr 8, 2025
(WIP) depends on the previous PR
#469

This change provides YARD with sufficient information about the
models(classes). Many of the comments created are the same as the types
in RBS, as well as existing descriptions and variable names.

Since YARD uses a different notation than RBS, you can consider this as
an adaptation to that notation, and there should be almost no issues.
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.

2 participants