Skip to content

Commit de5d9b4

Browse files
committed
Test yard and update contributing
1 parent ee3a243 commit de5d9b4

4 files changed

Lines changed: 46 additions & 8 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- run: bundle install
3636
- run: bundle exec rubocop
3737
- run: bundle exec rspec
38+
- run: bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
3839

3940
rbs:
4041
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
1-
## How to contribute to LINE Bot SDK for Ruby project
1+
# How to contribute to LINE Bot SDK for Ruby project
22

3-
First of all, thank you so much for taking your time to contribute! LINE Bot SDK for Ruby is not very different from any other open
4-
source projects you are aware of. It will be amazing if you could help us by doing any of the following:
3+
First of all, thank you so much for taking your time to contribute!
4+
LINE Bot SDK for Ruby is not very different from any other open source projects you are aware of.
5+
It will be amazing if you could help us by doing any of the following:
56

6-
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues) to report bugs and propose new features and
7-
improvements.
7+
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues) to report bugs and propose new features and improvements.
88
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues).
99
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-ruby/pulls).
1010

11+
## Development
12+
13+
### YARD
14+
15+
We use [YARD](https://yardoc.org) to generate and maintain our code documentation.
16+
**Please make sure your new or modified code is also covered by proper YARD doc comments.**
17+
Good documentation ensures that contributors and users can easily read and understand how the methods and classes work.
18+
19+
#### How to generate and view documentation locally
20+
21+
##### 1. **Start a local documentation server**
22+
23+
Run the following command to start a local YARD server that will automatically reload when files change:
24+
25+
```bash
26+
bundle exec yard server --reload
27+
```
28+
29+
Then open the printed URL in your browser (e.g., http://localhost:8808).
30+
31+
##### 2. **Validate your documentation**
32+
33+
Before pushing your changes, run the following command to check YARD documentation coverage and warnings:
34+
```bash
35+
bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
36+
```
37+
This will fail if there are missing doc comments or any YARD-specific warnings.
38+
Make sure to fix any issues before creating a pull request.
39+
40+
For more details on how to write YARD doc comments, refer to YARD’s official [Getting Started guide](https://rubydoc.info/gems/yard/file/docs/GettingStarted.md).
41+
1142
### Contributor license agreement
1243

13-
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign
14-
[the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-ruby). Please
15-
[contact us](mailto:dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement).
44+
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign [the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-ruby).
45+
Please [contact us](mailto:dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement).

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ gem 'multipart-post', '~> 2.4.1', require: false
66

77
group :development, :test do
88
# ref: http://docs.rubocop.org/en/latest/installation/
9+
gem 'rack', '~> 2.2'
910
gem 'rubocop', '~> 1.75.0', require: false
11+
gem 'webrick', '~> 1.9.1'
1012
gem 'yard', '~> 0.9.20'
1113
end
1214

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ GEM
2727
prism (1.4.0)
2828
public_suffix (6.0.1)
2929
racc (1.8.1)
30+
rack (2.2.13)
3031
rainbow (3.1.1)
3132
rake (13.2.1)
3233
regexp_parser (2.10.0)
@@ -66,20 +67,24 @@ GEM
6667
addressable (>= 2.8.0)
6768
crack (>= 0.3.2)
6869
hashdiff (>= 0.4.0, < 2.0.0)
70+
webrick (1.9.1)
6971
yard (0.9.37)
7072

7173
PLATFORMS
74+
arm64-darwin-21
7275
arm64-darwin-22
7376
x86_64-linux
7477

7578
DEPENDENCIES
7679
addressable (~> 2.3)
7780
line-bot-api!
7881
multipart-post (~> 2.4.1)
82+
rack (~> 2.2)
7983
rake (~> 13.0)
8084
rspec (~> 3.13.0)
8185
rubocop (~> 1.75.0)
8286
webmock (~> 3.25.0)
87+
webrick (~> 1.9.1)
8388
yard (~> 0.9.20)
8489

8590
BUNDLED WITH

0 commit comments

Comments
 (0)