review-tools 0.1.10 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README-ja.md +105 -0
- data/lib/review/tools/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef02d3e243775ba6964e21d64716d4b3e879334182a555aa984825c815bce763
|
4
|
+
data.tar.gz: 07c76208b498e20522af214aaa4085d112a635b0346cfcf43d75b9aadd749bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b274c366a736a41284f64d3e064731d52b4bebd8fa690db4699c7b1c5985a86c3aebb45b38a225e91dc593f9b1e086c66266edf579b52fd378b1e4b92e5f6f60
|
7
|
+
data.tar.gz: 8ed2cb4a3325cd28dbce8900e3774994abef8ada9269f5c5d0fdc7699c8ae540def9ab0a62f3361a180ec5dc063a396515f175b18ec88f6557635659963053e0
|
data/Gemfile.lock
CHANGED
data/README-ja.md
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
[](https://travis-ci.org/hgwr/review-tools)
|
2
|
+
[](https://badge.fury.io/rb/review-tools)
|
3
|
+
|
4
|
+
# Review::Tools
|
5
|
+
|
6
|
+
review-tools gem は、 GitHub 上の Rails プロジェクトの pull request をレビューするときの作業を、半自動化するためのツールです。
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
おすすめは `gem install review-tools` でグローバルインストールしてしまうことです。
|
11
|
+
|
12
|
+
プロダクションコードに、このろくでもない gem への依存性をつけないほうがいいと思うからです。
|
13
|
+
|
14
|
+
こんな感じのワンライナーで、使用している各 Ruby のバージョンへ gem install できます。
|
15
|
+
|
16
|
+
`orig_version=`rbenv version | sed -e 's/ .*$//'`; for rbv in `rbenv versions | sed -e 's/^[* ]*//' | cut -d ' ' -f 1 | grep -v system`; do echo rbenv global $rbv; gem install review-tools; done; rbenv global $orig_version`
|
17
|
+
|
18
|
+
もしくは Gemfile に加えてしまってもいいでしょう。
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'review-tools', require: false, group: :development
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
1. GitHub のプルリクエストのページに、下記のような表示があると思います。
|
31
|
+
|
32
|
+
> ### add some cool features #2
|
33
|
+
>
|
34
|
+
> **Open** hgwr wants to merge 4 commits into master from dev
|
35
|
+
|
36
|
+
2. この文字列のうち `into master from dev` をコピーし、コマンドライン上へ `run_review into master from dev` とペースとします。
|
37
|
+
|
38
|
+
3. そして `run_review into master from dev` を実行すると、次のようなことが置きます。
|
39
|
+
|
40
|
+
- 適切に関連するブランチを `git checkout`
|
41
|
+
- DB migration とか、ブランチ間で Ruby や Node のバージョンが違っても適当に bundle install や node_modules 作り直しとかやってくれます。
|
42
|
+
- RSpec や ng test など実行されます。
|
43
|
+
- simplecov gem をお使いなら `coverages/index.html` というファイルができます。そしてこのツールは、変更のあったファイルのみのカバレッジ状況を出力します。
|
44
|
+
|
45
|
+
4. もちろん、上の 3. のうち、各機能をバラバラに使用することもできます。
|
46
|
+
|
47
|
+
4.1 レビュー対象の親ブランチと、レビュー対象のブランチを git checkout して git pull するコマンド。
|
48
|
+
|
49
|
+
`git_checkout_target_branches into milestone/abc from feature/cde`
|
50
|
+
|
51
|
+
4.2 いろいろよしなに準備してくれるコマンド
|
52
|
+
|
53
|
+
`prepare_rails_and_frontend`
|
54
|
+
|
55
|
+
4.3 テストを実行してくれるコマンド
|
56
|
+
|
57
|
+
`check_and_test`
|
58
|
+
|
59
|
+
4.4 修正のあったファイルだけ、カバレッジの内容を表示してくれるコマンド
|
60
|
+
|
61
|
+
`analyze_coverage into milestone/abc from feature/cde`
|
62
|
+
|
63
|
+
## カスタマイズ
|
64
|
+
|
65
|
+
`~/.config/review-tools.yml` という設定ファイルに、追加のタスクをシェルスクリプトで書けます。
|
66
|
+
|
67
|
+
たとえば、 `prepare_rails_and_frontend` コマンドで frontend の準備をしたかったり、
|
68
|
+
`db:gmigarete` 以外にも DB 関連のタスクを実行したかったりする場合があります。
|
69
|
+
|
70
|
+
また、設定ファイルに `additional_task test_tasks` という項目をついかすると、追加のテストもしてくれます。
|
71
|
+
下記の例では `do_frontend_test` 環境変数が設定されている場合は、 `npm test` や `eslint` を実行するような設定です。
|
72
|
+
|
73
|
+
```
|
74
|
+
additional_preparation: |
|
75
|
+
rm -rf node_modules && yarn
|
76
|
+
|
77
|
+
additional_db_preparation: |
|
78
|
+
bundle exec bin/rails db:some:your:task
|
79
|
+
|
80
|
+
additional_test_tasks: |
|
81
|
+
if [ ! -z "${do_frontend_test:-}" ]; then
|
82
|
+
npm test
|
83
|
+
eslint app/assets/javascripts/**/*
|
84
|
+
fi
|
85
|
+
```
|
86
|
+
|
87
|
+
## review-tools のソースコードについて
|
88
|
+
|
89
|
+
gem ファイルだから Ruby で書かれていると思いました?
|
90
|
+
|
91
|
+
残念! ほとんどシェルスクリプトで書かれています。
|
92
|
+
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/hgwr/review-tools.
|
96
|
+
This project is intended to be a safe, welcoming space for collaboration,
|
97
|
+
and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
98
|
+
|
99
|
+
## License
|
100
|
+
|
101
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
102
|
+
|
103
|
+
## Code of Conduct
|
104
|
+
|
105
|
+
Everyone interacting in the Review::Tools project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hgwr/review-tools/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/review/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: review-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeru Hagiwara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- Gemfile
|
88
88
|
- Gemfile.lock
|
89
89
|
- LICENSE.txt
|
90
|
+
- README-ja.md
|
90
91
|
- README.md
|
91
92
|
- Rakefile
|
92
93
|
- bin/check_and_test.sh
|