review-tools 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +19 -11
- data/README.md +6 -3
- data/bin/{check-and-test.sh → check_and_test.sh} +7 -7
- data/bin/{common-functions.sh → common_functions.sh} +0 -0
- data/bin/{git-checkout-target-branches.sh → git_checkout_target_branches.sh} +2 -2
- data/bin/{prepare-rails-and-frontend.sh → prepare_rails_and_frontend.sh} +2 -2
- data/bin/run_review.sh +9 -9
- data/{bin/analyze_coverage.rb → exe/analyze_coverage} +7 -10
- data/exe/check_and_test +6 -0
- data/exe/git_checkout_target_branches +6 -0
- data/exe/prepare_rails_and_frontend +6 -0
- data/exe/run_review +6 -0
- data/lib/review/tools/version.rb +1 -1
- metadata +17 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a35696c465254cd6de8c5bac93b7c291f96086e27b2581d07dcd1696353eb4d4
|
4
|
+
data.tar.gz: 30c55b1b9b5b40b586140a12ec3576dc35e15d878a8849f0786c914698507599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 017dc06a9697b3781fb3aa0e58e61ef2547e0f6102fbfa2d80e30a6b59e51d0a9433c9664d3e43bd7c2a43e530769b98e7602f79015d66a936db5ff22acf41a6
|
7
|
+
data.tar.gz: e5275446d2d7a5d8a7c97a879fca69a43d9af27e4c9f6f0d921081d7a65839686e9b47ea295d6f0682bcf2b41cfe8b6cf71bc4e605c4aef6f2c59428a0d61455
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
review-tools (0.1.6)
|
5
|
+
nokogiri (~> 1.10.4)
|
6
|
+
|
1
7
|
GEM
|
2
8
|
remote: https://rubygems.org/
|
3
9
|
specs:
|
4
|
-
addressable (2.
|
5
|
-
public_suffix (>= 2.0.2, <
|
10
|
+
addressable (2.7.0)
|
11
|
+
public_suffix (>= 2.0.2, < 5.0)
|
6
12
|
ast (2.4.0)
|
7
13
|
byebug (11.0.1)
|
8
14
|
coderay (1.1.2)
|
@@ -18,14 +24,14 @@ GEM
|
|
18
24
|
gitlab (4.12.0)
|
19
25
|
httparty (~> 0.14, >= 0.14.0)
|
20
26
|
terminal-table (~> 1.5, >= 1.5.1)
|
21
|
-
httparty (0.17.
|
27
|
+
httparty (0.17.1)
|
22
28
|
mime-types (~> 3.0)
|
23
29
|
multi_xml (>= 0.5.2)
|
24
30
|
jaro_winkler (1.5.3)
|
25
31
|
method_source (0.9.2)
|
26
|
-
mime-types (3.
|
32
|
+
mime-types (3.3)
|
27
33
|
mime-types-data (~> 3.2015)
|
28
|
-
mime-types-data (3.2019.
|
34
|
+
mime-types-data (3.2019.0904)
|
29
35
|
mini_portile2 (2.4.0)
|
30
36
|
multi_xml (0.6.0)
|
31
37
|
multipart-post (2.1.1)
|
@@ -34,9 +40,9 @@ GEM
|
|
34
40
|
octokit (4.14.0)
|
35
41
|
sawyer (~> 0.8.0, >= 0.5.3)
|
36
42
|
parallel (1.17.0)
|
37
|
-
parser (2.6.
|
43
|
+
parser (2.6.4.1)
|
38
44
|
ast (~> 2.4.0)
|
39
|
-
path_expander (1.0
|
45
|
+
path_expander (1.1.0)
|
40
46
|
pronto (0.10.0)
|
41
47
|
gitlab (~> 4.0, >= 4.0.0)
|
42
48
|
httparty (>= 0.13.7)
|
@@ -56,7 +62,7 @@ GEM
|
|
56
62
|
pry-byebug (3.7.0)
|
57
63
|
byebug (~> 11.0)
|
58
64
|
pry (~> 0.10)
|
59
|
-
public_suffix (
|
65
|
+
public_suffix (4.0.1)
|
60
66
|
rainbow (3.0.0)
|
61
67
|
rake (10.5.0)
|
62
68
|
rspec (3.8.0)
|
@@ -80,13 +86,13 @@ GEM
|
|
80
86
|
ruby-progressbar (~> 1.7)
|
81
87
|
unicode-display_width (>= 1.4.0, < 1.7)
|
82
88
|
ruby-progressbar (1.10.1)
|
83
|
-
ruby_parser (3.
|
89
|
+
ruby_parser (3.14.0)
|
84
90
|
sexp_processor (~> 4.9)
|
85
91
|
rugged (0.28.3.1)
|
86
92
|
sawyer (0.8.2)
|
87
93
|
addressable (>= 2.3.5)
|
88
94
|
faraday (> 0.8, < 2.0)
|
89
|
-
sexp_processor (4.
|
95
|
+
sexp_processor (4.13.0)
|
90
96
|
terminal-table (1.8.0)
|
91
97
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
92
98
|
thor (0.20.3)
|
@@ -96,13 +102,15 @@ PLATFORMS
|
|
96
102
|
ruby
|
97
103
|
|
98
104
|
DEPENDENCIES
|
105
|
+
bundler (~> 2.0)
|
99
106
|
byebug
|
100
|
-
nokogiri
|
107
|
+
nokogiri (~> 1.10.4)
|
101
108
|
pronto
|
102
109
|
pronto-flay
|
103
110
|
pronto-rubocop
|
104
111
|
pry-byebug
|
105
112
|
rake (~> 10.0)
|
113
|
+
review-tools!
|
106
114
|
rspec
|
107
115
|
|
108
116
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -30,9 +30,9 @@ Or install it yourself as:
|
|
30
30
|
>
|
31
31
|
> **Open** hgwr wants to merge 4 commits into master from dev
|
32
32
|
|
33
|
-
2. Copy `into master from dev` and paste like `run_review
|
33
|
+
2. Copy `into master from dev` and paste like `run_review into master from dev` to terminal.
|
34
34
|
|
35
|
-
3. Then, `run_review
|
35
|
+
3. Then, Run `run_review into master from dev`. It executes these operaitons.
|
36
36
|
|
37
37
|
- `git checkout ...`
|
38
38
|
- Preparing environments. (e.g. Database migrations)
|
@@ -53,7 +53,10 @@ additional_db_preparation: |
|
|
53
53
|
bundle exec bin/rails db:some:your:task
|
54
54
|
|
55
55
|
additional_test_tasks: |
|
56
|
-
|
56
|
+
if [ ! -z "${do_frontend_tst:-}" ]; then
|
57
|
+
npm test
|
58
|
+
eslint app/assets/javascripts/**/*
|
59
|
+
fi
|
57
60
|
```
|
58
61
|
|
59
62
|
## Contributing
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
#
|
3
|
-
# Usage:
|
3
|
+
# Usage: check_and_test.sh
|
4
4
|
#
|
5
5
|
# Example of ~/.config/review-tools.yml
|
6
6
|
#
|
@@ -17,28 +17,28 @@ trap 'echo "Ctrl-C captured and exit."; exit 1' INT
|
|
17
17
|
trap 'echo "some error occured at $(pwd) and exit."; exit 8' SIGHUP
|
18
18
|
|
19
19
|
script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
|
20
|
-
source "${script_dir}/
|
20
|
+
source "${script_dir}/common_functions.sh"
|
21
21
|
|
22
22
|
load_environment_variables test_environment_variables
|
23
23
|
|
24
24
|
mkdir -p log
|
25
25
|
cp /dev/null log/test.log
|
26
26
|
|
27
|
-
if [ `(grep 'pronto' Gemfile || true) | wc -l` -
|
27
|
+
if [ `(grep 'pronto' Gemfile || true) | wc -l` -ge "1" ]; then
|
28
28
|
bundle exec pronto run
|
29
|
-
elif [ `(which pront || true) | wc -l` -
|
29
|
+
elif [ `(which pront || true) | wc -l` -ge "1" ]; then
|
30
30
|
pronto run
|
31
31
|
fi
|
32
32
|
|
33
|
-
if [ `(grep 'rspec' Gemfile || true) | wc -l` -
|
33
|
+
if [ `(grep 'rspec' Gemfile || true) | wc -l` -ge "1" ]; then
|
34
34
|
bundle exec rspec spec
|
35
35
|
else
|
36
36
|
bundle exec rake test
|
37
37
|
fi
|
38
38
|
|
39
|
-
if [ `(grep 'rubocop' Gemfile || true) | wc -l` -
|
39
|
+
if [ `(grep 'rubocop' Gemfile || true) | wc -l` -ge "1" ]; then
|
40
40
|
bundle exec rubocop
|
41
|
-
elif [ `(which rubocop || true) | wc -l` -
|
41
|
+
elif [ `(which rubocop || true) | wc -l` -ge "1" ]; then
|
42
42
|
rubocop
|
43
43
|
fi
|
44
44
|
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
#
|
3
|
-
# Usage:
|
3
|
+
# Usage: git_checkout_target_branches.sh into milestone/abc from feature/cde
|
4
4
|
#
|
5
5
|
|
6
6
|
set -o errexit
|
@@ -12,7 +12,7 @@ trap 'echo "Ctrl-C captured and exit."; exit 1' INT
|
|
12
12
|
trap 'echo "some error occured at $(pwd) and exit."; exit 8' SIGHUP
|
13
13
|
|
14
14
|
if [ $# -ne 4 ] || [ "$1" != "into" ] || [ "$3" != "from" ]; then
|
15
|
-
echo "Usage:
|
15
|
+
echo "Usage: git_checkout_target_branches into milestone/abc from feature/cde" 1>&2
|
16
16
|
exit 1
|
17
17
|
fi
|
18
18
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
#
|
3
|
-
# Usage:
|
3
|
+
# Usage: prepare_rails_and_frontend.sh
|
4
4
|
#
|
5
5
|
# Example of ~/.config/review-tools.yml
|
6
6
|
#
|
@@ -20,7 +20,7 @@ trap 'echo "Ctrl-C captured and exit."; exit 1' INT
|
|
20
20
|
trap 'echo "some error occured at $(pwd) and exit."; exit 8' SIGHUP
|
21
21
|
|
22
22
|
script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
|
23
|
-
source "${script_dir}/
|
23
|
+
source "${script_dir}/common_functions.sh"
|
24
24
|
|
25
25
|
if [ ! -d .git ]; then
|
26
26
|
echo "Error: no git repository" 1>&2
|
data/bin/run_review.sh
CHANGED
@@ -9,13 +9,13 @@ set -o nounset
|
|
9
9
|
set -o xtrace
|
10
10
|
|
11
11
|
script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
|
12
|
-
source "${script_dir}/
|
12
|
+
source "${script_dir}/common_functions.sh"
|
13
13
|
|
14
14
|
trap 'echo "Ctrl-C captured and exit."; exit 1' INT
|
15
15
|
trap 'echo "some error occured at $(pwd) and exit."; exit 8' SIGHUP
|
16
16
|
|
17
17
|
if [ $# -ne 4 ] || [ "$1" != "into" ] || [ "$3" != "from" ]; then
|
18
|
-
echo "Usage:
|
18
|
+
echo "Usage: run_review into milestone/abc from feature/cde" 1>&2
|
19
19
|
exit 1
|
20
20
|
fi
|
21
21
|
|
@@ -26,17 +26,17 @@ mkdir -p ~/tmp
|
|
26
26
|
logifle=~/tmp/run_review_`date +'%Y%m%d-%H%M%S'`.log
|
27
27
|
|
28
28
|
(
|
29
|
-
"${script_dir}/
|
30
|
-
show_notification "run_review.sh" "Failed:
|
29
|
+
"${script_dir}/git_checkout_target_branches.sh" into "$dst_branch" from "$src_branch" ||
|
30
|
+
show_notification "run_review.sh" "Failed: git_checkout_target_branches.sh" $error_exit
|
31
31
|
|
32
|
-
"${script_dir}/
|
33
|
-
show_notification "run_review.sh" "Failed:
|
32
|
+
"${script_dir}/prepare_rails_and_frontend.sh" ||
|
33
|
+
show_notification "run_review.sh" "Failed: prepare_rails_and_frontend.sh" $error_exit
|
34
34
|
|
35
|
-
"${script_dir}/
|
36
|
-
show_notification "run_review.sh" "Failed:
|
35
|
+
"${script_dir}/check_and_test.sh" ||
|
36
|
+
show_notification "run_review.sh" "Failed: check_and_test.sh" $error_exit
|
37
37
|
|
38
38
|
if [ -r 'coverage/index.html' ]; then
|
39
|
-
"${script_dir}/analyze_coverage
|
39
|
+
"${script_dir}/analyze_coverage" into "$dst_branch" from "$src_branch"
|
40
40
|
fi
|
41
41
|
|
42
42
|
) 2>&1 | tee "$logifle"
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
|
-
# require 'pry'
|
5
4
|
|
6
5
|
unless File.exist?('coverage/index.html')
|
7
6
|
warn 'Error: coverage/index.html dose not exist.'
|
@@ -11,7 +10,7 @@ end
|
|
11
10
|
html_doc = File.open('coverage/index.html') { |f| Nokogiri::HTML(f) }
|
12
11
|
|
13
12
|
if ARGV.length != 4 || ARGV[0] != 'into' || ARGV[2] != 'from'
|
14
|
-
warn 'Usage: analyze_coverage
|
13
|
+
warn 'Usage: analyze_coverage into milestone/abc from feature/cde'
|
15
14
|
exit 1
|
16
15
|
end
|
17
16
|
|
@@ -19,14 +18,13 @@ dst_branch = ARGV[1]
|
|
19
18
|
src_branch = ARGV[3]
|
20
19
|
|
21
20
|
`git diff --name-only #{dst_branch}..#{src_branch}`.split("\n").each do |file_name|
|
22
|
-
|
23
21
|
next unless file_name =~ /\.rb\z/
|
24
22
|
|
25
|
-
a_tags = html_doc.css(%
|
23
|
+
a_tags = html_doc.css(%(a[title="#{file_name}"]))
|
26
24
|
|
27
25
|
puts "\n========== #{file_name} =========="
|
28
|
-
if a_tags.length
|
29
|
-
puts
|
26
|
+
if a_tags.length.zero?
|
27
|
+
puts ' no results'
|
30
28
|
next
|
31
29
|
end
|
32
30
|
|
@@ -41,13 +39,12 @@ src_branch = ARGV[3]
|
|
41
39
|
linenumber = li['data-linenumber']
|
42
40
|
case li['class']
|
43
41
|
when 'missed'
|
44
|
-
printf '%
|
42
|
+
printf '%06d x ', linenumber
|
45
43
|
when 'covered'
|
46
|
-
printf '%
|
44
|
+
printf '%06d o ', linenumber
|
47
45
|
else
|
48
|
-
printf '%
|
46
|
+
printf '%06d ? ', linenumber
|
49
47
|
end
|
50
48
|
puts li.css('code').text
|
51
49
|
end
|
52
|
-
|
53
50
|
end
|
data/exe/check_and_test
ADDED
data/exe/run_review
ADDED
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.1.
|
4
|
+
version: 0.1.6
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -70,7 +70,12 @@ description: This is a tool that automates the review of pull requests for Rails
|
|
70
70
|
on GitHub.
|
71
71
|
email:
|
72
72
|
- hgwrsgr@gmail.com
|
73
|
-
executables:
|
73
|
+
executables:
|
74
|
+
- analyze_coverage
|
75
|
+
- check_and_test
|
76
|
+
- git_checkout_target_branches
|
77
|
+
- prepare_rails_and_frontend
|
78
|
+
- run_review
|
74
79
|
extensions: []
|
75
80
|
extra_rdoc_files: []
|
76
81
|
files:
|
@@ -84,14 +89,18 @@ files:
|
|
84
89
|
- LICENSE.txt
|
85
90
|
- README.md
|
86
91
|
- Rakefile
|
87
|
-
- bin/
|
88
|
-
- bin/
|
89
|
-
- bin/common-functions.sh
|
92
|
+
- bin/check_and_test.sh
|
93
|
+
- bin/common_functions.sh
|
90
94
|
- bin/console
|
91
|
-
- bin/
|
92
|
-
- bin/
|
95
|
+
- bin/git_checkout_target_branches.sh
|
96
|
+
- bin/prepare_rails_and_frontend.sh
|
93
97
|
- bin/run_review.sh
|
94
98
|
- bin/setup
|
99
|
+
- exe/analyze_coverage
|
100
|
+
- exe/check_and_test
|
101
|
+
- exe/git_checkout_target_branches
|
102
|
+
- exe/prepare_rails_and_frontend
|
103
|
+
- exe/run_review
|
95
104
|
- lib/review/tools.rb
|
96
105
|
- lib/review/tools/version.rb
|
97
106
|
- review-tools.gemspec
|