Skip to content

Commit 583894b

Browse files
committed
Test yard and update contributing
1 parent a83bc52 commit 583894b

4 files changed

Lines changed: 55 additions & 4 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ jobs:
4747
- run: gem install rbs
4848
- run: rbs -I sig validate
4949

50+
yard:
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
54+
steps:
55+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
56+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
57+
with:
58+
ruby-version: '3.2'
59+
- run: bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
60+
5061
pinact:
5162
runs-on: ubuntu-latest
5263
permissions:

CONTRIBUTING.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
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
3+
First of all, thank you so much for taking your time to contribute! LINE Bot SDK for Ruby is not very different
4+
from any other open
45
source projects you are aware of. 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+
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues) to report bugs and
8+
propose new features and
79
improvements.
810
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-ruby/issues).
911
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-ruby/pulls).
1012

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

1346
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign
1447
[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).
48+
[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
@@ -8,6 +8,8 @@ group :development, :test do
88
# ref: http://docs.rubocop.org/en/latest/installation/
99
gem 'rubocop', '~> 1.75.0', require: false
1010
gem 'yard', '~> 0.9.20'
11+
gem 'webrick'
12+
gem 'rack', '~> 2.2'
1113
end
1214

1315
group :test do

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
8388
yard (~> 0.9.20)
8489

8590
BUNDLED WITH

0 commit comments

Comments
 (0)