rubocop_pr 1.0.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/rubocop_pr/cli/process_cop.rb +1 -1
- data/lib/rubocop_pr/options.rb +16 -1
- data/lib/rubocop_pr/repositories/github.rb +10 -1
- data/lib/rubocop_pr/rubocop.rb +2 -2
- data/lib/rubocop_pr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d9556b71acd309753dbdb674136ffd61627cd8689fe32e295f937f800e452f0
|
4
|
+
data.tar.gz: a76c9b82f51dc2dbdbb08e1be30dbc677621693bc2486aadd899561dbe3ab45b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d561f2980992818b056f8287b845896e85f5ba1ff4a4e38164b6004401d9d301104c3d1fc9bf62e8c7da3453fb042a26ee05d0ccdf70334db4b45f81bb1f0f
|
7
|
+
data.tar.gz: 03d9bb0f56ffc8fd3194cf3e87a098a32efb19274cbb2405157e9846dc0572ed9a906d64e59ee4477c41fcc567c8288fdf68f90d66cbed931a29523b2d3715b4
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ Or install it yourself as:
|
|
38
38
|
|
39
39
|
```bash
|
40
40
|
Usage: rubocop_pr [options]
|
41
|
-
-
|
41
|
+
-k, --post-checkout [command] Running after each git checkout (default: "")
|
42
42
|
-c, --continue Continue previous session (default: false)
|
43
43
|
-b, --branch [branch] internal branch with '.rubocop_todo.yml' (default: 'rubocop_todo_branch')
|
44
44
|
-m, --master [branch] branch which will be the base for all PR's (default: 'master')
|
@@ -51,6 +51,8 @@ Usage: rubocop_pr [options]
|
|
51
51
|
-a, --issue-assignees [name] Issue assignees, separated by comma (default: "")
|
52
52
|
-t [name], Pull request assignees, separated by comma (default: "")
|
53
53
|
--pull-request-assignees
|
54
|
+
-r [name], Pull request reviewers, separated by comma (default: "")
|
55
|
+
--pull-request-reviewers
|
54
56
|
-g, --repository [name] Set repository host (default: github)
|
55
57
|
-l, --limit [limit] Limit the PS's for one run (default: 10)
|
56
58
|
-h, --help Display help
|
data/lib/rubocop_pr/options.rb
CHANGED
@@ -40,7 +40,7 @@ module RubocopPr
|
|
40
40
|
def add_post_checkout_option
|
41
41
|
@options.post_checkout = ''
|
42
42
|
msg = 'Running after each git checkout (default: "")'
|
43
|
-
opts.on('-
|
43
|
+
opts.on('-k [command]', '--post-checkout [command]', String, msg) do |v|
|
44
44
|
@options.post_checkout = v
|
45
45
|
end
|
46
46
|
end
|
@@ -109,6 +109,14 @@ module RubocopPr
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
def add_pull_request_reviewers_option
|
113
|
+
@options.pull_request_reviewers = []
|
114
|
+
msg = 'Pull request reviewers, separated by comma (default: "")'
|
115
|
+
opts.on('-r [name] ', '--pull-request-reviewers [name]', Array, msg) do |v|
|
116
|
+
@options.pull_request_reviewers = v
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
112
120
|
def add_repository_option
|
113
121
|
@options.repository = 'github'
|
114
122
|
msg = 'Set repository host (default: github)'
|
@@ -117,6 +125,13 @@ module RubocopPr
|
|
117
125
|
end
|
118
126
|
end
|
119
127
|
|
128
|
+
def add_all_option
|
129
|
+
@options.all = false
|
130
|
+
opts.on('-a', '--all', 'Use -A flag for rubocop command (default: false)') do |_v|
|
131
|
+
@options.all = true
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
120
135
|
def add_continue_option
|
121
136
|
@options.continue = false
|
122
137
|
opts.on('-c', '--continue', 'Continue previous session (default: false)') do |_v|
|
@@ -44,7 +44,7 @@ module RubocopPr
|
|
44
44
|
opt << "-m '#{body}'" unless body.blank?
|
45
45
|
opt << "-a '#{assignees.join(',')}'" unless assignees.blank?
|
46
46
|
opt << "-l '#{labels.join(',')}'" unless labels.blank?
|
47
|
-
end
|
47
|
+
end
|
48
48
|
end
|
49
49
|
|
50
50
|
def default_title
|
@@ -78,10 +78,13 @@ module RubocopPr
|
|
78
78
|
|
79
79
|
# The representation of the PR
|
80
80
|
class PullRequest < Base
|
81
|
+
attr_reader :reviewers
|
82
|
+
|
81
83
|
def initialize(cop:, **opt)
|
82
84
|
super
|
83
85
|
@assignees = Array opt[:pull_request_assignees]
|
84
86
|
@labels = Array opt[:pull_request_labels]
|
87
|
+
@reviewers = Array opt[:pull_request_reviewers]
|
85
88
|
end
|
86
89
|
|
87
90
|
private
|
@@ -89,6 +92,12 @@ module RubocopPr
|
|
89
92
|
def command
|
90
93
|
'hub pull-request create'
|
91
94
|
end
|
95
|
+
|
96
|
+
def cli_options
|
97
|
+
super.tap do |opt|
|
98
|
+
opt << "-r '#{reviewers.join(',')}'" unless reviewers.blank?
|
99
|
+
end
|
100
|
+
end
|
92
101
|
end
|
93
102
|
|
94
103
|
class << self
|
data/lib/rubocop_pr/rubocop.rb
CHANGED
data/lib/rubocop_pr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kvokka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|