rubocop_challenger 2.0.0.pre9 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -11
- data/.dependabot/config.yml +18 -0
- data/.gem_comet.yml +19 -1
- data/.rubocop.yml +10 -2
- data/.rubocop_challenge.yml +3 -0
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +314 -0
- data/Gemfile.lock +88 -54
- data/README.md +21 -33
- data/challenger.gemspec +8 -4
- data/lib/rubocop_challenger.rb +1 -0
- data/lib/rubocop_challenger/bundler/command.rb +5 -1
- data/lib/rubocop_challenger/cli.rb +9 -0
- data/lib/rubocop_challenger/go.rb +39 -24
- data/lib/rubocop_challenger/pull_request.rb +6 -3
- data/lib/rubocop_challenger/rubocop/challenge.rb +6 -5
- data/lib/rubocop_challenger/rubocop/command.rb +6 -2
- data/lib/rubocop_challenger/rubocop/rule.rb +1 -1
- data/lib/rubocop_challenger/rubocop/yardoc.rb +12 -10
- data/lib/rubocop_challenger/version.rb +1 -1
- data/lib/templates/error.md.erb +4 -0
- metadata +49 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9de614d27c025b681596e5f3e59cfdd0faf220647f6d5f74b5ba1d1b6e3c4714
|
4
|
+
data.tar.gz: 7a7f66167b732e1db0c24dc764f568ebf65f8379cfa8f00ea77e16f3659fa075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b808e5e3d05bed8fc1793d812eded0b17168d392ae0219bdfe96ccb5a1be77cdc9bb96e3d33b40c91f8f1deb354cec555fdd563f5e2f1c5b4c3fd53b774e9ab
|
7
|
+
data.tar.gz: 128d208942ccd3d8d198a4bdf506428e0efcfb766d898fc6e606b1cc6fe2f445be63269ac1742ed80e731c8c2a621b90f63af8afb03d33bc24eb28e3835d4225
|
data/.circleci/config.yml
CHANGED
@@ -5,22 +5,22 @@
|
|
5
5
|
version: 2.1
|
6
6
|
|
7
7
|
orbs:
|
8
|
-
ruby-orbs: sue445/ruby-orbs@1.
|
8
|
+
ruby-orbs: sue445/ruby-orbs@1.6.1
|
9
9
|
code-climate: rvla/code-climate@0.0.2
|
10
10
|
|
11
11
|
references:
|
12
12
|
- &ruby_version
|
13
13
|
ruby_version:
|
14
14
|
type: enum
|
15
|
-
enum: ['2.
|
16
|
-
default: '
|
15
|
+
enum: ['2.5', '2.6', '2.7', '3.0', 'latest']
|
16
|
+
default: '3.0'
|
17
17
|
|
18
18
|
executors:
|
19
19
|
default:
|
20
20
|
parameters:
|
21
21
|
<<: *ruby_version
|
22
22
|
docker:
|
23
|
-
- image: circleci/ruby:<< parameters.ruby_version
|
23
|
+
- image: circleci/ruby:<< parameters.ruby_version >>
|
24
24
|
working_directory: ~/repo
|
25
25
|
|
26
26
|
commands:
|
@@ -41,7 +41,7 @@ commands:
|
|
41
41
|
- code-climate/format-coverage:
|
42
42
|
input-type: simplecov
|
43
43
|
prefix: $(readlink -f .)
|
44
|
-
coverage-file: coverage
|
44
|
+
coverage-file: coverage/coverage.json
|
45
45
|
output: coverage/codeclimate.$CIRCLE_BUILD_NUM.json
|
46
46
|
- persist_to_workspace:
|
47
47
|
root: coverage
|
@@ -128,6 +128,9 @@ commands:
|
|
128
128
|
<<: *ruby_version
|
129
129
|
steps:
|
130
130
|
- checkout
|
131
|
+
- run:
|
132
|
+
name: Install Bundler 2.x
|
133
|
+
command: gem install bundler:2.1.4
|
131
134
|
- ruby-orbs/bundle-install:
|
132
135
|
cache_key_prefix: v1-dependencies-<< parameters.ruby_version >>
|
133
136
|
test_and_build:
|
@@ -156,7 +159,7 @@ jobs:
|
|
156
159
|
- code-climate/install
|
157
160
|
- code-climate/sum-coverage:
|
158
161
|
input: codeclimate.*.json
|
159
|
-
parts:
|
162
|
+
parts: 5
|
160
163
|
- code-climate/upload-coverage
|
161
164
|
rubocop:
|
162
165
|
executor: default
|
@@ -189,15 +192,18 @@ workflows:
|
|
189
192
|
|
190
193
|
commit:
|
191
194
|
jobs:
|
192
|
-
- build:
|
193
|
-
name: build_on_ruby_2.4
|
194
|
-
ruby_version: '2.4'
|
195
195
|
- build:
|
196
196
|
name: build_on_ruby_2.5
|
197
197
|
ruby_version: '2.5'
|
198
198
|
- build:
|
199
199
|
name: build_on_ruby_2.6
|
200
200
|
ruby_version: '2.6'
|
201
|
+
- build:
|
202
|
+
name: build_on_ruby_2.7
|
203
|
+
ruby_version: '2.7'
|
204
|
+
- build:
|
205
|
+
name: build_on_ruby_3.0
|
206
|
+
ruby_version: '3.0'
|
201
207
|
- build:
|
202
208
|
name: build_on_ruby_latest
|
203
209
|
ruby_version: 'latest'
|
@@ -206,16 +212,18 @@ workflows:
|
|
206
212
|
- integration_testing
|
207
213
|
- upload-coverage:
|
208
214
|
requires:
|
209
|
-
- build_on_ruby_2.4
|
210
215
|
- build_on_ruby_2.5
|
211
216
|
- build_on_ruby_2.6
|
217
|
+
- build_on_ruby_2.7
|
218
|
+
- build_on_ruby_3.0
|
212
219
|
- build_on_ruby_latest
|
213
220
|
- release:
|
214
221
|
context: RubyGems API Key
|
215
222
|
requires:
|
216
|
-
- build_on_ruby_2.4
|
217
223
|
- build_on_ruby_2.5
|
218
224
|
- build_on_ruby_2.6
|
225
|
+
- build_on_ruby_2.7
|
226
|
+
- build_on_ruby_3.0
|
219
227
|
- build_on_ruby_latest
|
220
228
|
- rubocop
|
221
229
|
filters:
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version: 1
|
2
|
+
update_configs:
|
3
|
+
- package_manager: "ruby:bundler"
|
4
|
+
directory: "/"
|
5
|
+
update_schedule: "live"
|
6
|
+
default_reviewers:
|
7
|
+
- "ryz310"
|
8
|
+
default_assignees:
|
9
|
+
- "ryz310"
|
10
|
+
default_labels:
|
11
|
+
- "dependabot"
|
12
|
+
automerged_updates:
|
13
|
+
- match:
|
14
|
+
dependency_type: "development"
|
15
|
+
update_type: "all"
|
16
|
+
- match:
|
17
|
+
dependency_type: "production"
|
18
|
+
update_type: "semver:patch"
|
data/.gem_comet.yml
CHANGED
@@ -1,6 +1,24 @@
|
|
1
|
-
|
1
|
+
# [Usage]
|
2
|
+
#
|
3
|
+
# $ gem install gem_comet
|
4
|
+
# $ gem_comet init
|
5
|
+
# $ gem_comet release {version number, like as "1.2.3"}
|
6
|
+
# $ gem_comet changelog
|
7
|
+
# $ gem_comet versions
|
8
|
+
|
9
|
+
version: 1.2
|
2
10
|
|
3
11
|
release:
|
4
12
|
base_branch: master
|
5
13
|
release_branch: production
|
6
14
|
version_file_path: lib/rubocop_challenger/version.rb
|
15
|
+
changelog_file_path: CHANGELOG.md # optional
|
16
|
+
changelog:
|
17
|
+
categories:
|
18
|
+
- Feature
|
19
|
+
- Bugfix
|
20
|
+
- Security
|
21
|
+
- Breaking Change
|
22
|
+
- Rubocop Challenge
|
23
|
+
- Dependabot
|
24
|
+
- Misc
|
data/.rubocop.yml
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-performance
|
3
|
+
- rubocop-rake
|
3
4
|
- rubocop-rspec
|
4
5
|
|
5
6
|
inherit_from: .rubocop_todo.yml
|
6
7
|
|
7
8
|
AllCops:
|
8
|
-
TargetRubyVersion: 2.
|
9
|
+
TargetRubyVersion: 2.5
|
10
|
+
NewCops: enable
|
9
11
|
|
10
12
|
Metrics/BlockLength:
|
11
13
|
Exclude:
|
12
14
|
- 'challenger.gemspec'
|
13
15
|
- 'spec/**/*'
|
14
16
|
|
17
|
+
Naming/VariableNumber:
|
18
|
+
EnforcedStyle: snake_case
|
19
|
+
|
15
20
|
# For integration testing
|
16
21
|
RSpec/MultipleExpectations:
|
17
22
|
Exclude:
|
18
|
-
- 'spec/rubocop_challenger/cli_spec.rb'
|
23
|
+
- 'spec/lib/rubocop_challenger/cli_spec.rb'
|
24
|
+
|
25
|
+
RSpec/MultipleMemoizedHelpers:
|
26
|
+
Max: 10
|
19
27
|
|
20
28
|
RSpec/NestedGroups:
|
21
29
|
Max: 4
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --exclude-limit 30 --no-auto-gen-timestamp`
|
3
|
-
# using RuboCop version
|
3
|
+
# using RuboCop version 1.8.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,314 @@
|
|
1
|
+
# Change log
|
2
|
+
|
3
|
+
## v2.2.0 (Jan 11, 2021)
|
4
|
+
|
5
|
+
### Feature
|
6
|
+
|
7
|
+
* [#449](https://github.com/ryz310/rubocop_challenger/pull/449) Add verbose option ([@ryz310](https://github.com/ryz310))
|
8
|
+
|
9
|
+
### Dependabot
|
10
|
+
|
11
|
+
* [#447](https://github.com/ryz310/rubocop_challenger/pull/447) ryz310/dependabot/bundler/rubocop-1.8.1 ([@ryz310](https://github.com/ryz310))
|
12
|
+
|
13
|
+
## v2.1.0 (Jan 11, 2021)
|
14
|
+
|
15
|
+
### Feature
|
16
|
+
|
17
|
+
* [#441](https://github.com/ryz310/rubocop_challenger/pull/441) Improve PR description generation ([@ryz310](https://github.com/ryz310))
|
18
|
+
|
19
|
+
### Rubocop Challenge
|
20
|
+
|
21
|
+
* [#442](https://github.com/ryz310/rubocop_challenger/pull/442) Re-generate .rubocop_todo.yml with RuboCop v1.8.0 ([@ryz310](https://github.com/ryz310))
|
22
|
+
|
23
|
+
### Dependabot
|
24
|
+
|
25
|
+
* [#444](https://github.com/ryz310/rubocop_challenger/pull/444) Update simplecov requirement from = 0.17.1 to = 0.21.2 ([@ryz310](https://github.com/ryz310))
|
26
|
+
|
27
|
+
## v2.0.1 (Jan 06, 2021)
|
28
|
+
|
29
|
+
### Bugfix
|
30
|
+
|
31
|
+
* [#437](https://github.com/ryz310/rubocop_challenger/pull/437) Fix keyword argument expanding for Ruby 3.0 ([@ryz310](https://github.com/ryz310))
|
32
|
+
|
33
|
+
## v2.0.0 (Jan 04, 2021)
|
34
|
+
|
35
|
+
### Feature
|
36
|
+
|
37
|
+
* [#183](https://github.com/ryz310/rubocop_challenger/pull/183) Implement the flow that create a PR which re-generate ".rubocop_todo.yml" ([@ryz310](https://github.com/ryz310))
|
38
|
+
* [#187](https://github.com/ryz310/rubocop_challenger/pull/187) Bundle update rubocop ([@ryz310](https://github.com/ryz310))
|
39
|
+
* [#208](https://github.com/ryz310/rubocop_challenger/pull/208) Render links for release note and compare page ([@ryz310](https://github.com/ryz310))
|
40
|
+
* [#217](https://github.com/ryz310/rubocop_challenger/pull/217) Support auto gem config options ([@ryz310](https://github.com/ryz310))
|
41
|
+
* [#250](https://github.com/ryz310/rubocop_challenger/pull/250) Add error reporting feature ([@ryz310](https://github.com/ryz310))
|
42
|
+
* [#253](https://github.com/ryz310/rubocop_challenger/pull/253) Add information of the rubocop challenge ([@ryz310](https://github.com/ryz310))
|
43
|
+
* [#288](https://github.com/ryz310/rubocop_challenger/pull/288) Support ruby 2.7 ([@ryz310](https://github.com/ryz310))
|
44
|
+
* [#362](https://github.com/ryz310/rubocop_challenger/pull/362) Use rubocop auto correct all ([@ryz310](https://github.com/ryz310))
|
45
|
+
* [#398](https://github.com/ryz310/rubocop_challenger/pull/398) Add auto correct safe option ([@ryz310](https://github.com/ryz310))
|
46
|
+
* [#432](https://github.com/ryz310/rubocop_challenger/pull/432) Support ruby 3.0 ([@ryz310](https://github.com/ryz310))
|
47
|
+
|
48
|
+
### Bugfix
|
49
|
+
|
50
|
+
* [#212](https://github.com/ryz310/rubocop_challenger/pull/212) Fix the version of pr_comet ([@ryz310](https://github.com/ryz310))
|
51
|
+
* [#231](https://github.com/ryz310/rubocop_challenger/pull/231) Fix the way of requirements loading for optional dependencies ([@ryz310](https://github.com/ryz310))
|
52
|
+
* [#238](https://github.com/ryz310/rubocop_challenger/pull/238) Fix/load error of the updated gems ([@ryz310](https://github.com/ryz310))
|
53
|
+
* [#363](https://github.com/ryz310/rubocop_challenger/pull/363) Require rubocop-rails gem ([@ryz310](https://github.com/ryz310))
|
54
|
+
|
55
|
+
### Breaking Change
|
56
|
+
|
57
|
+
* [#180](https://github.com/ryz310/rubocop_challenger/pull/180) Farewell ruby 2.3 ([@ryz310](https://github.com/ryz310))
|
58
|
+
* [#184](https://github.com/ryz310/rubocop_challenger/pull/184) Remove base branch option ([@ryz310](https://github.com/ryz310))
|
59
|
+
* [#396](https://github.com/ryz310/rubocop_challenger/pull/396) End of support for Ruby 2.4 ([@ryz310](https://github.com/ryz310))
|
60
|
+
|
61
|
+
### Rubocop Challenge
|
62
|
+
|
63
|
+
* [#228](https://github.com/ryz310/rubocop_challenger/pull/228) Style/WordArray-20190625233039 ([@ryz310](https://github.com/ryz310))
|
64
|
+
* [#235](https://github.com/ryz310/rubocop_challenger/pull/235) Performance/RegexpMatch-20190729233033 ([@ryz310](https://github.com/ryz310))
|
65
|
+
* [#236](https://github.com/ryz310/rubocop_challenger/pull/236) Layout/SpaceAroundOperators-20190731233025 ([@ryz310](https://github.com/ryz310))
|
66
|
+
* [#317](https://github.com/ryz310/rubocop_challenger/pull/317) Performance/StartWith-20200523233027 ([@ryz310](https://github.com/ryz310))
|
67
|
+
* [#427](https://github.com/ryz310/rubocop_challenger/pull/427) Re-generate .rubocop_todo.yml with RuboCop v1.7.0 ([@ryz310](https://github.com/ryz310))
|
68
|
+
|
69
|
+
### Dependabot
|
70
|
+
|
71
|
+
* [#242](https://github.com/ryz310/rubocop_challenger/pull/242) ryz310/dependabot/bundler/rake-tw-13.0 ([@ryz310](https://github.com/ryz310))
|
72
|
+
* [#244](https://github.com/ryz310/rubocop_challenger/pull/244) ryz310/dependabot/bundler/simplecov-0.17.1 ([@ryz310](https://github.com/ryz310))
|
73
|
+
* [#245](https://github.com/ryz310/rubocop_challenger/pull/245) ryz310/dependabot/bundler/pr_comet-gte-0.2-and-lt-0.4 ([@ryz310](https://github.com/ryz310))
|
74
|
+
* [#271](https://github.com/ryz310/rubocop_challenger/pull/271) Bump thor from 1.0.0 to 1.0.1 ([@ryz310](https://github.com/ryz310))
|
75
|
+
* [#303](https://github.com/ryz310/rubocop_challenger/pull/303) ryz310/dependabot/bundler/pry-byebug-3.9.0 ([@ryz310](https://github.com/ryz310))
|
76
|
+
* [#376](https://github.com/ryz310/rubocop_challenger/pull/376) ryz310/dependabot/bundler/rspec-3.10.0 ([@ryz310](https://github.com/ryz310))
|
77
|
+
* [#414](https://github.com/ryz310/rubocop_challenger/pull/414) ryz310/dependabot/bundler/rubocop-rspec-2.0.1 ([@ryz310](https://github.com/ryz310))
|
78
|
+
* [#421](https://github.com/ryz310/rubocop_challenger/pull/421) ryz310/dependabot/bundler/rubocop-1.6.1 ([@ryz310](https://github.com/ryz310))
|
79
|
+
* [#423](https://github.com/ryz310/rubocop_challenger/pull/423) ryz310/dependabot/bundler/rubocop-rails-2.9.1 ([@ryz310](https://github.com/ryz310))
|
80
|
+
* [#426](https://github.com/ryz310/rubocop_challenger/pull/426) ryz310/dependabot/bundler/rake-13.0.3 ([@ryz310](https://github.com/ryz310))
|
81
|
+
* [#428](https://github.com/ryz310/rubocop_challenger/pull/428) ryz310/dependabot/bundler/yard-0.9.26 ([@ryz310](https://github.com/ryz310))
|
82
|
+
* [#431](https://github.com/ryz310/rubocop_challenger/pull/431) ryz310/dependabot/bundler/rubocop-performance-1.9.2 ([@ryz310](https://github.com/ryz310))
|
83
|
+
|
84
|
+
### Security
|
85
|
+
|
86
|
+
* [#230](https://github.com/ryz310/rubocop_challenger/pull/230) Bump yard from 0.9.19 to 0.9.20 ([@ryz310](https://github.com/ryz310))
|
87
|
+
|
88
|
+
### Misc
|
89
|
+
|
90
|
+
* [#178](https://github.com/ryz310/rubocop_challenger/pull/178) Use #abort instead of #puts and #exit! ([@ryz310](https://github.com/ryz310))
|
91
|
+
* [#181](https://github.com/ryz310/rubocop_challenger/pull/181) Remove waffle.io badge ([@ryz310](https://github.com/ryz310))
|
92
|
+
* [#185](https://github.com/ryz310/rubocop_challenger/pull/185) Improve code coverage and fix implements ([@ryz310](https://github.com/ryz310))
|
93
|
+
* [#186](https://github.com/ryz310/rubocop_challenger/pull/186) Use #abort instead of #exit! ([@ryz310](https://github.com/ryz310))
|
94
|
+
* [#192](https://github.com/ryz310/rubocop_challenger/pull/192) Extract with pr comet ([@ryz310](https://github.com/ryz310))
|
95
|
+
* [#216](https://github.com/ryz310/rubocop_challenger/pull/216) Use rainbow gem ([@ryz310](https://github.com/ryz310))
|
96
|
+
* [#218](https://github.com/ryz310/rubocop_challenger/pull/218) Add pull request to GitHub project on execute ([@ryz310](https://github.com/ryz310))
|
97
|
+
* [#219](https://github.com/ryz310/rubocop_challenger/pull/219) Add auto updating target gems ([@ryz310](https://github.com/ryz310))
|
98
|
+
* [#223](https://github.com/ryz310/rubocop_challenger/pull/223) Support base branch option ([@ryz310](https://github.com/ryz310))
|
99
|
+
* [#227](https://github.com/ryz310/rubocop_challenger/pull/227) Migrate circle ci version to 2.1 ([@ryz310](https://github.com/ryz310))
|
100
|
+
* [#239](https://github.com/ryz310/rubocop_challenger/pull/239) Introduce gem comet ([@ryz310](https://github.com/ryz310))
|
101
|
+
* [#294](https://github.com/ryz310/rubocop_challenger/pull/294) Update ruby-orbs orb to v1.6.0 ([@ryz310](https://github.com/ryz310))
|
102
|
+
* [#304](https://github.com/ryz310/rubocop_challenger/pull/304) Edit dependabot configuration ([@ryz310](https://github.com/ryz310))
|
103
|
+
* [#433](https://github.com/ryz310/rubocop_challenger/pull/433) Update `pr_comet` ([@ryz310](https://github.com/ryz310))
|
104
|
+
|
105
|
+
## v1.2.0 (Feb 27, 2019)
|
106
|
+
|
107
|
+
### Feature
|
108
|
+
|
109
|
+
* Challenge incompleted list ([#170](https://github.com/ryz310/rubocop_challenger/pull/170))
|
110
|
+
|
111
|
+
### Bugfix
|
112
|
+
|
113
|
+
* Fix exit code when no more auto-correctable rule ([#175](https://github.com/ryz310/rubocop_challenger/pull/175))
|
114
|
+
|
115
|
+
### Breaking Change
|
116
|
+
|
117
|
+
* Remove "regenerate-rubocop-todo" option ([#170](https://github.com/ryz310/rubocop_challenger/pull/170))
|
118
|
+
|
119
|
+
## v1.1.2 (Feb 21, 2019)
|
120
|
+
|
121
|
+
### Feature
|
122
|
+
|
123
|
+
* Re-generate .rubocop_todo.yml on pre-challenge ([#169](https://github.com/ryz310/rubocop_challenger/pull/169))
|
124
|
+
|
125
|
+
## v1.1.1 (Jan 17, 2019)
|
126
|
+
|
127
|
+
### Bugfix
|
128
|
+
|
129
|
+
* Fix encountering name error when finding a cop class by cop name ([#164](https://github.com/ryz310/rubocop_challenger/pull/164))
|
130
|
+
|
131
|
+
### Misc
|
132
|
+
|
133
|
+
* Configure Renovate ([#162](https://github.com/ryz310/rubocop_challenger/pull/162))
|
134
|
+
|
135
|
+
## v1.1.0 (Dec 29, 2018)
|
136
|
+
|
137
|
+
### Feature
|
138
|
+
|
139
|
+
* Support ruby 2.6 ([#156](https://github.com/ryz310/rubocop_challenger/pull/156))
|
140
|
+
|
141
|
+
### Misc
|
142
|
+
|
143
|
+
* Change emoji on the commit message ([#158](https://github.com/ryz310/rubocop_challenger/pull/158))
|
144
|
+
|
145
|
+
## v1.0.0 (Dec 3, 2018)
|
146
|
+
|
147
|
+
Release v1.0.0 :tada:
|
148
|
+
|
149
|
+
## v1.0.0.pre4 (Nov 26, 2018)
|
150
|
+
|
151
|
+
### Security
|
152
|
+
|
153
|
+
* Add quiet option on git push command ([#149](https://github.com/ryz310/rubocop_challenger/pull/149))
|
154
|
+
|
155
|
+
### Misc
|
156
|
+
|
157
|
+
* Add yard testing flow ([#150](https://github.com/ryz310/rubocop_challenger/pull/150))
|
158
|
+
* Add jailbreak script ([#151](https://github.com/ryz310/rubocop_challenger/pull/151))
|
159
|
+
|
160
|
+
## v1.0.0.pre3 (Nov 17, 2018)
|
161
|
+
|
162
|
+
### Feature
|
163
|
+
|
164
|
+
* Output the result in the execution ([#139](https://github.com/ryz310/rubocop_challenger/pull/139))
|
165
|
+
* Colorize error log ([#145](https://github.com/ryz310/rubocop_challenger/pull/145))
|
166
|
+
|
167
|
+
### Bugfix
|
168
|
+
|
169
|
+
* Filter access token in the command logging ([#144](https://github.com/ryz310/rubocop_challenger/pull/144))
|
170
|
+
|
171
|
+
## v1.0.0.pre2 (Nov 15, 2018)
|
172
|
+
|
173
|
+
### Feature
|
174
|
+
|
175
|
+
* Support private repository ([#132](https://github.com/ryz310/rubocop_challenger/pull/132))
|
176
|
+
* Support old git version ([#133](https://github.com/ryz310/rubocop_challenger/pull/133))
|
177
|
+
|
178
|
+
### Misc
|
179
|
+
|
180
|
+
* Add Github::Client#add_labels spec ([#131](https://github.com/ryz310/rubocop_challenger/pull/131))
|
181
|
+
* Remove a unnecessary option ([#134](https://github.com/ryz310/rubocop_challenger/pull/134))
|
182
|
+
|
183
|
+
## v1.0.0.pre (Nov 13, 2018)
|
184
|
+
|
185
|
+
### Feature
|
186
|
+
|
187
|
+
* Use octokit ([#121](https://github.com/ryz310/rubocop_challenger/pull/121))
|
188
|
+
|
189
|
+
### Breaking Change
|
190
|
+
|
191
|
+
* Change `--regenerate-rubocop-todo` option default value to true
|
192
|
+
|
193
|
+
### Misc
|
194
|
+
|
195
|
+
* Modify gem version validator ([#127](https://github.com/ryz310/rubocop_challenger/pull/127))
|
196
|
+
|
197
|
+
## v0.5.2 (Nov 4, 2018)
|
198
|
+
|
199
|
+
### Misc
|
200
|
+
|
201
|
+
* Install code climate ([#116](https://github.com/ryz310/rubocop_challenger/pull/116))
|
202
|
+
* Fix coveralls badge URL ([#117](https://github.com/ryz310/rubocop_challenger/pull/117))
|
203
|
+
* Uninstall coveralls ([#118](https://github.com/ryz310/rubocop_challenger/pull/118))
|
204
|
+
|
205
|
+
## v0.5.1 (Nov 1, 2018)
|
206
|
+
|
207
|
+
### Misc
|
208
|
+
|
209
|
+
* Style/MutableConstant at Tue Oct 30 23:30:33 UTC 2018 ([#106](https://github.com/ryz310/rubocop_challenger/pull/106))
|
210
|
+
* Install coveralls ([#107](https://github.com/ryz310/rubocop_challenger/pull/107))
|
211
|
+
* Definition of Metrics/BlockLength ([#109](https://github.com/ryz310/rubocop_challenger/pull/109))
|
212
|
+
* Fix offense of RSpec/ExampleLength ([#110](https://github.com/ryz310/rubocop_challenger/pull/110))
|
213
|
+
* Fix offense of Style/Documentation ([#111](https://github.com/ryz310/rubocop_challenger/pull/111))
|
214
|
+
* Fix offense of Metrics/LineLength ([#112](https://github.com/ryz310/rubocop_challenger/pull/112))
|
215
|
+
* Fix that testing target is wrong ([#113](https://github.com/ryz310/rubocop_challenger/pull/113))
|
216
|
+
|
217
|
+
## v0.5.0 (Oct 30, 2018)
|
218
|
+
|
219
|
+
### Feature
|
220
|
+
|
221
|
+
* Use bundle exec ([#100](https://github.com/ryz310/rubocop_challenger/pull/100))
|
222
|
+
|
223
|
+
### Breaking Change
|
224
|
+
|
225
|
+
* Return example name ([#101](https://github.com/ryz310/rubocop_challenger/pull/101))
|
226
|
+
|
227
|
+
### Misc
|
228
|
+
|
229
|
+
* Layout/AlignHash at Sun Oct 28 23:30:20 UTC 2018 ([#97](https://github.com/ryz310/rubocop_challenger/pull/97))
|
230
|
+
* Add Rubocop Challenge example to the README.md ([#98](https://github.com/ryz310/rubocop_challenger/pull/98))
|
231
|
+
* Update bundle when create release PR ([#103](https://github.com/ryz310/rubocop_challenger/pull/103))
|
232
|
+
|
233
|
+
## v0.4.1 (Oct 28, 2018)
|
234
|
+
|
235
|
+
### Bugfix
|
236
|
+
|
237
|
+
* Return status code 0 when exists no auto-correctable cop ([#91](https://github.com/ryz310/rubocop_challenger/pull/91))
|
238
|
+
* Fix rubocop version mismatch ([#92](https://github.com/ryz310/rubocop_challenger/pull/92))
|
239
|
+
|
240
|
+
### Misc
|
241
|
+
|
242
|
+
* Style/RedundantSelf at Fri Oct 26 05:58:13 UTC 2018 ([#89](https://github.com/ryz310/rubocop_challenger/pull/89))
|
243
|
+
* Layout/SpaceInsideBlockBraces at Sat Oct 27 23:30:21 UTC 2018 ([#93](https://github.com/ryz310/rubocop_challenger/pull/93))
|
244
|
+
|
245
|
+
## v0.4.0 (Oct 26, 2018)
|
246
|
+
|
247
|
+
### Feature
|
248
|
+
|
249
|
+
* Generate document from yardoc ([#86](https://github.com/ryz310/rubocop_challenger/pull/86))
|
250
|
+
|
251
|
+
### Misc
|
252
|
+
|
253
|
+
* Rake/create pr for version up ([#81](https://github.com/ryz310/rubocop_challenger/pull/81))
|
254
|
+
* Style/RescueModifier at Wed Oct 24 23:30:21 UTC 2018 ([#82](https://github.com/ryz310/rubocop_challenger/pull/82))
|
255
|
+
|
256
|
+
## v0.3.1 (Oct 23, 2018)
|
257
|
+
|
258
|
+
### Feature
|
259
|
+
|
260
|
+
* Modify default template ([#73](https://github.com/ryz310/rubocop_challenger/pull/73))
|
261
|
+
|
262
|
+
|
263
|
+
## v0.3.0 (Oct 23, 2018)
|
264
|
+
|
265
|
+
### Feature
|
266
|
+
|
267
|
+
* Add labels option ([#67](https://github.com/ryz310/rubocop_challenger/pull/67))
|
268
|
+
* Add template option ([#70](https://github.com/ryz310/rubocop_challenger/pull/70))
|
269
|
+
|
270
|
+
### Misc
|
271
|
+
|
272
|
+
* Run rubocop challenge after release ([#68](https://github.com/ryz310/rubocop_challenger/pull/68))
|
273
|
+
|
274
|
+
## v0.2.1 (Oct 23, 2019)
|
275
|
+
|
276
|
+
### Bugfix
|
277
|
+
|
278
|
+
* Fix default PR template file path ([#64](https://github.com/ryz310/rubocop_challenger/pull/64))
|
279
|
+
|
280
|
+
## v0.2.0 (Oct 23, 2018)
|
281
|
+
|
282
|
+
### Feature
|
283
|
+
|
284
|
+
* Generate pr template ([#50](https://github.com/ryz310/rubocop_challenger/pull/50))
|
285
|
+
* Add no-commit option ([#53](https://github.com/ryz310/rubocop_challenger/pull/53))
|
286
|
+
* Return status code 1 when an error occurs ([#56](https://github.com/ryz310/rubocop_challenger/pull/56))
|
287
|
+
* Add option which regenerate rubocop todo file ([#59](https://github.com/ryz310/rubocop_challenger/pull/59))
|
288
|
+
|
289
|
+
### Misc
|
290
|
+
|
291
|
+
* Add access token description ([#48](https://github.com/ryz310/rubocop_challenger/pull/48))
|
292
|
+
* Add no document option to gem install command ([#51](https://github.com/ryz310/rubocop_challenger/pull/51))
|
293
|
+
|
294
|
+
## v0.1.3 (Oct 21, 2018)
|
295
|
+
|
296
|
+
### Misc
|
297
|
+
|
298
|
+
* Style/TrailingCommaInArrayLiteral at Fri Oct 19 23:30:18 UTC 2018 ([#34](https://github.com/ryz310/rubocop_challenger/pull/34))
|
299
|
+
* Update readme ([#36](https://github.com/ryz310/rubocop_challenger/pull/36))
|
300
|
+
* Add challenge class spec ([#42](https://github.com/ryz310/rubocop_challenger/pull/42))
|
301
|
+
|
302
|
+
## v0.1.2 (Oct 19, 2018)
|
303
|
+
|
304
|
+
### Misc
|
305
|
+
|
306
|
+
* Install from gem ([#28](https://github.com/ryz310/rubocop_challenger/pull/28))
|
307
|
+
|
308
|
+
## v0.1.1 (Oct 19, 2018)
|
309
|
+
|
310
|
+
Minor fixes
|
311
|
+
|
312
|
+
## v0.1.0 (Oct 18, 2018)
|
313
|
+
|
314
|
+
Initial release! :rocket:
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop_challenger (2.
|
5
|
-
pr_comet (
|
4
|
+
rubocop_challenger (2.2.0)
|
5
|
+
pr_comet (~> 0.5.1)
|
6
6
|
rainbow
|
7
|
-
rubocop
|
7
|
+
rubocop (>= 0.87)
|
8
8
|
rubocop-performance
|
9
|
+
rubocop-rails
|
10
|
+
rubocop-rake
|
9
11
|
rubocop-rspec
|
10
12
|
thor
|
11
13
|
yard
|
@@ -13,86 +15,118 @@ PATH
|
|
13
15
|
GEM
|
14
16
|
remote: https://rubygems.org/
|
15
17
|
specs:
|
18
|
+
activesupport (6.1.1)
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
|
+
i18n (>= 1.6, < 2)
|
21
|
+
minitest (>= 5.1)
|
22
|
+
tzinfo (~> 2.0)
|
23
|
+
zeitwerk (~> 2.3)
|
16
24
|
addressable (2.7.0)
|
17
25
|
public_suffix (>= 2.0.2, < 5.0)
|
18
|
-
ast (2.4.
|
19
|
-
byebug (11.
|
20
|
-
coderay (1.1.
|
21
|
-
|
22
|
-
|
23
|
-
|
26
|
+
ast (2.4.1)
|
27
|
+
byebug (11.1.3)
|
28
|
+
coderay (1.1.3)
|
29
|
+
concurrent-ruby (1.1.7)
|
30
|
+
diff-lcs (1.4.4)
|
31
|
+
docile (1.3.4)
|
32
|
+
faraday (1.3.0)
|
33
|
+
faraday-net_http (~> 1.0)
|
24
34
|
multipart-post (>= 1.2, < 3)
|
25
|
-
|
26
|
-
|
27
|
-
|
35
|
+
ruby2_keywords
|
36
|
+
faraday-net_http (1.0.0)
|
37
|
+
i18n (1.8.7)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
method_source (1.0.0)
|
40
|
+
minitest (5.14.3)
|
28
41
|
multipart-post (2.1.1)
|
29
|
-
octokit (4.
|
42
|
+
octokit (4.20.0)
|
43
|
+
faraday (>= 0.9)
|
30
44
|
sawyer (~> 0.8.0, >= 0.5.3)
|
31
|
-
parallel (1.
|
32
|
-
parser (
|
33
|
-
ast (~> 2.4.
|
34
|
-
pr_comet (0.
|
45
|
+
parallel (1.20.1)
|
46
|
+
parser (3.0.0.0)
|
47
|
+
ast (~> 2.4.1)
|
48
|
+
pr_comet (0.5.1)
|
35
49
|
octokit
|
36
50
|
rainbow
|
37
|
-
pry (0.
|
38
|
-
coderay (~> 1.1
|
39
|
-
method_source (~>
|
40
|
-
pry-byebug (3.
|
51
|
+
pry (0.13.1)
|
52
|
+
coderay (~> 1.1)
|
53
|
+
method_source (~> 1.0)
|
54
|
+
pry-byebug (3.9.0)
|
41
55
|
byebug (~> 11.0)
|
42
|
-
pry (~> 0.
|
43
|
-
public_suffix (4.0.
|
56
|
+
pry (~> 0.13.0)
|
57
|
+
public_suffix (4.0.6)
|
58
|
+
rack (2.2.3)
|
44
59
|
rainbow (3.0.0)
|
45
|
-
rake (13.0.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
rspec-
|
50
|
-
|
51
|
-
rspec-
|
52
|
-
rspec-
|
60
|
+
rake (13.0.3)
|
61
|
+
regexp_parser (2.0.3)
|
62
|
+
rexml (3.2.4)
|
63
|
+
rspec (3.10.0)
|
64
|
+
rspec-core (~> 3.10.0)
|
65
|
+
rspec-expectations (~> 3.10.0)
|
66
|
+
rspec-mocks (~> 3.10.0)
|
67
|
+
rspec-core (3.10.1)
|
68
|
+
rspec-support (~> 3.10.0)
|
69
|
+
rspec-expectations (3.10.1)
|
53
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-mocks (3.
|
71
|
+
rspec-support (~> 3.10.0)
|
72
|
+
rspec-mocks (3.10.1)
|
56
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-support (3.
|
74
|
+
rspec-support (~> 3.10.0)
|
75
|
+
rspec-support (3.10.1)
|
59
76
|
rspec_junit_formatter (0.4.1)
|
60
77
|
rspec-core (>= 2, < 4, != 2.12.0)
|
61
|
-
rubocop (
|
62
|
-
jaro_winkler (~> 1.5.1)
|
78
|
+
rubocop (1.8.1)
|
63
79
|
parallel (~> 1.10)
|
64
|
-
parser (>=
|
80
|
+
parser (>= 3.0.0.0)
|
65
81
|
rainbow (>= 2.2.2, < 4.0)
|
82
|
+
regexp_parser (>= 1.8, < 3.0)
|
83
|
+
rexml
|
84
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
66
85
|
ruby-progressbar (~> 1.7)
|
67
|
-
unicode-display_width (>= 1.4.0, <
|
68
|
-
rubocop-
|
69
|
-
|
70
|
-
rubocop-
|
71
|
-
rubocop (>= 0.
|
72
|
-
|
86
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
87
|
+
rubocop-ast (1.4.0)
|
88
|
+
parser (>= 2.7.1.5)
|
89
|
+
rubocop-performance (1.9.2)
|
90
|
+
rubocop (>= 0.90.0, < 2.0)
|
91
|
+
rubocop-ast (>= 0.4.0)
|
92
|
+
rubocop-rails (2.9.1)
|
93
|
+
activesupport (>= 4.2.0)
|
94
|
+
rack (>= 1.1)
|
95
|
+
rubocop (>= 0.90.0, < 2.0)
|
96
|
+
rubocop-rake (0.5.1)
|
97
|
+
rubocop
|
98
|
+
rubocop-rspec (2.1.0)
|
99
|
+
rubocop (~> 1.0)
|
100
|
+
rubocop-ast (>= 1.1.0)
|
101
|
+
ruby-progressbar (1.11.0)
|
102
|
+
ruby2_keywords (0.0.2)
|
73
103
|
sawyer (0.8.2)
|
74
104
|
addressable (>= 2.3.5)
|
75
105
|
faraday (> 0.8, < 2.0)
|
76
|
-
simplecov (0.
|
106
|
+
simplecov (0.21.2)
|
77
107
|
docile (~> 1.1)
|
78
|
-
|
79
|
-
|
80
|
-
simplecov-html (0.
|
81
|
-
|
82
|
-
|
83
|
-
|
108
|
+
simplecov-html (~> 0.11)
|
109
|
+
simplecov_json_formatter (~> 0.1)
|
110
|
+
simplecov-html (0.12.3)
|
111
|
+
simplecov_json_formatter (0.1.2)
|
112
|
+
thor (1.0.1)
|
113
|
+
tzinfo (2.0.4)
|
114
|
+
concurrent-ruby (~> 1.0)
|
115
|
+
unicode-display_width (2.0.0)
|
116
|
+
yard (0.9.26)
|
117
|
+
zeitwerk (2.4.2)
|
84
118
|
|
85
119
|
PLATFORMS
|
86
120
|
ruby
|
87
121
|
|
88
122
|
DEPENDENCIES
|
89
|
-
bundler (
|
123
|
+
bundler (>= 2.0)
|
90
124
|
pry-byebug
|
91
125
|
rake (~> 13.0)
|
92
126
|
rspec
|
93
127
|
rspec_junit_formatter
|
94
128
|
rubocop_challenger!
|
95
|
-
simplecov
|
129
|
+
simplecov (= 0.21.2)
|
96
130
|
|
97
131
|
BUNDLED WITH
|
98
|
-
|
132
|
+
2.2.3
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ version: 2
|
|
56
56
|
jobs:
|
57
57
|
rubocop_challenge:
|
58
58
|
docker:
|
59
|
-
- image: circleci/ruby:
|
59
|
+
- image: circleci/ruby:3.0
|
60
60
|
working_directory: ~/repo
|
61
61
|
steps:
|
62
62
|
- checkout
|
@@ -83,20 +83,6 @@ workflows:
|
|
83
83
|
- rubocop_challenge
|
84
84
|
```
|
85
85
|
|
86
|
-
If you added `rubocop_challenger` gem in your Gemfile so please modify script of installing and execution as following:
|
87
|
-
|
88
|
-
```yml
|
89
|
-
steps:
|
90
|
-
- checkout
|
91
|
-
- run:
|
92
|
-
name: Rubocop Challenge
|
93
|
-
command: |
|
94
|
-
bundle install
|
95
|
-
bundle exec rubocop_challenger go \
|
96
|
-
--email=rubocop-challenger@example.com \
|
97
|
-
--name="Rubocop Challenger"
|
98
|
-
```
|
99
|
-
|
100
86
|
## CLI command references
|
101
87
|
|
102
88
|
```sh
|
@@ -117,30 +103,32 @@ Usage:
|
|
117
103
|
rubocop_challenger go --email=EMAIL --name=NAME
|
118
104
|
|
119
105
|
Options:
|
120
|
-
--email=EMAIL
|
121
|
-
--name=NAME
|
122
|
-
f, [--file-path=FILE_PATH]
|
123
|
-
|
124
|
-
t, [--template=TEMPLATE]
|
125
|
-
[--mode=MODE]
|
126
|
-
|
127
|
-
b, [--base-branch=BASE_BRANCH]
|
128
|
-
|
129
|
-
l, [--labels=one two three]
|
130
|
-
|
131
|
-
[--project-column-name=PROJECT_COLUMN_NAME]
|
132
|
-
[--project-id=N]
|
133
|
-
[--no-create-pr]
|
134
|
-
[--exclude-limit=N]
|
135
|
-
[--auto-gen-timestamp], [--no-auto-gen-timestamp]
|
136
|
-
|
106
|
+
--email=EMAIL # The Pull Request committer email
|
107
|
+
--name=NAME # The Pull Request committer name
|
108
|
+
f, [--file-path=FILE_PATH] # Set your ".rubocop_todo.yml" path
|
109
|
+
# Default: .rubocop_todo.yml
|
110
|
+
t, [--template=TEMPLATE] # A Pull Request template `erb` file path.You can use variable that `title`, `rubydoc_url`, `description` and `examples` into the erb file.
|
111
|
+
[--mode=MODE] # Mode to select deletion target. You can choice "most_occurrence", "least_occurrence", or "random"
|
112
|
+
# Default: most_occurrence
|
113
|
+
b, [--base-branch=BASE_BRANCH] # The Branch to merge into
|
114
|
+
# Default: master
|
115
|
+
l, [--labels=one two three] # Label to give to Pull Request
|
116
|
+
# Default: ["rubocop challenge"]
|
117
|
+
[--project-column-name=PROJECT_COLUMN_NAME] # A project column name. You can add the created PR to the GitHub project
|
118
|
+
[--project-id=N] # A target project ID. If does not supplied, this method will find a project which associated the repository. When the repository has multiple projects, you should supply this.
|
119
|
+
[--no-create-pr] # No create a pull request (for testing)
|
120
|
+
[--exclude-limit=N] # For how many exclude properties when creating the .rubocop_todo.yml
|
121
|
+
[--auto-gen-timestamp], [--no-auto-gen-timestamp] # Include the date and time when creating the .rubocop_todo.yml
|
122
|
+
# Default: true
|
123
|
+
[--only-safe-auto-correct], [--no-only-safe-auto-correct] # If given `true`, it executes `rubocop --auto-correct`,it means to correct safe cops only.
|
124
|
+
[--verbose], [--no-verbose] # Displays executing command.
|
137
125
|
|
138
126
|
Run `$ rubocop --auto-correct` and create a PR to GitHub repo
|
139
127
|
```
|
140
128
|
|
141
129
|
## Requirement
|
142
130
|
|
143
|
-
* Ruby 2.
|
131
|
+
* Ruby 2.5 or higher
|
144
132
|
|
145
133
|
## Development
|
146
134
|
|
data/challenger.gemspec
CHANGED
@@ -22,18 +22,22 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.
|
25
|
+
spec.required_ruby_version = '>= 2.5'
|
26
|
+
|
27
|
+
spec.add_runtime_dependency 'pr_comet', '~> 0.5.1'
|
26
28
|
spec.add_runtime_dependency 'rainbow'
|
27
|
-
spec.add_runtime_dependency 'rubocop'
|
29
|
+
spec.add_runtime_dependency 'rubocop', '>= 0.87'
|
28
30
|
spec.add_runtime_dependency 'rubocop-performance'
|
31
|
+
spec.add_runtime_dependency 'rubocop-rails'
|
32
|
+
spec.add_runtime_dependency 'rubocop-rake'
|
29
33
|
spec.add_runtime_dependency 'rubocop-rspec'
|
30
34
|
spec.add_runtime_dependency 'thor'
|
31
35
|
spec.add_runtime_dependency 'yard'
|
32
36
|
|
33
|
-
spec.add_development_dependency 'bundler', '
|
37
|
+
spec.add_development_dependency 'bundler', '>= 2.0'
|
34
38
|
spec.add_development_dependency 'pry-byebug'
|
35
39
|
spec.add_development_dependency 'rake', '~> 13.0'
|
36
40
|
spec.add_development_dependency 'rspec'
|
37
41
|
spec.add_development_dependency 'rspec_junit_formatter'
|
38
|
-
spec.add_development_dependency 'simplecov'
|
42
|
+
spec.add_development_dependency 'simplecov', '0.21.2'
|
39
43
|
end
|
data/lib/rubocop_challenger.rb
CHANGED
@@ -6,11 +6,15 @@ module RubocopChallenger
|
|
6
6
|
class Command
|
7
7
|
include PrComet::CommandLine
|
8
8
|
|
9
|
+
def initialize(verbose: false)
|
10
|
+
@verbose = verbose
|
11
|
+
end
|
12
|
+
|
9
13
|
# Executes `$ bundle update` which excludes not installed gems
|
10
14
|
#
|
11
15
|
# @param gem_names [Array<String>] The target gem names
|
12
16
|
def update(*gem_names)
|
13
|
-
run('update', *gem_names.select
|
17
|
+
run('update', *gem_names.select { |gem_name| installed?(gem_name) })
|
14
18
|
end
|
15
19
|
|
16
20
|
# Checks the gem is installed
|
@@ -61,6 +61,15 @@ module RubocopChallenger
|
|
61
61
|
type: :boolean,
|
62
62
|
default: true,
|
63
63
|
desc: 'Include the date and time when creating the .rubocop_todo.yml'
|
64
|
+
option :'only-safe-auto-correct',
|
65
|
+
type: :boolean,
|
66
|
+
default: false,
|
67
|
+
desc: 'If given `true`, it executes `rubocop --auto-correct`,' \
|
68
|
+
'it means to correct safe cops only.'
|
69
|
+
option :verbose,
|
70
|
+
type: :boolean,
|
71
|
+
default: false,
|
72
|
+
desc: 'Displays executing command.'
|
64
73
|
def go
|
65
74
|
Go.new(options).exec
|
66
75
|
rescue Errors::NoAutoCorrectableRule => e
|
@@ -9,6 +9,9 @@ module RubocopChallenger
|
|
9
9
|
# For how many exclude properties when creating the ".rubocop_todo.yml"
|
10
10
|
# @option auto-gen-timestamp [Boolean]
|
11
11
|
# Include the date and time when creating the ".rubocop_todo.yml"
|
12
|
+
# @option only-safe-auto-correct [Boolean]
|
13
|
+
# If given `true`, it executes `rubocop --auto-correct`,
|
14
|
+
# it means to correct safe cops only.
|
12
15
|
# @option name [String]
|
13
16
|
# The author name which use at the git commit
|
14
17
|
# @option email [String]
|
@@ -23,11 +26,10 @@ module RubocopChallenger
|
|
23
26
|
# A target project ID. If does not supplied, this method will find a
|
24
27
|
# project which associated the repository. When the repository has
|
25
28
|
# multiple projects, you should supply this.
|
29
|
+
# @option verbose [Boolean]
|
30
|
+
# Displays executing command.
|
26
31
|
def initialize(options)
|
27
32
|
@options = options
|
28
|
-
@exclude_limit = options[:'exclude-limit']
|
29
|
-
@auto_gen_timestamp = options[:'auto-gen-timestamp']
|
30
|
-
@pull_request = PullRequest.new(extract_pull_request_options(options))
|
31
33
|
end
|
32
34
|
|
33
35
|
# Executes Rubocop Challenge flow
|
@@ -45,27 +47,15 @@ module RubocopChallenger
|
|
45
47
|
|
46
48
|
private
|
47
49
|
|
48
|
-
attr_reader :options
|
50
|
+
attr_reader :options
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
# @param options [Hash] The target options
|
53
|
-
# @return [Hash] Options for the PullRequest class
|
54
|
-
def extract_pull_request_options(options)
|
55
|
-
{
|
56
|
-
user_name: options[:name],
|
57
|
-
user_email: options[:email],
|
58
|
-
base_branch: options[:base_branch],
|
59
|
-
labels: options[:labels],
|
60
|
-
dry_run: options[:'no-create-pr'],
|
61
|
-
project_column_name: options[:project_column_name],
|
62
|
-
project_id: options[:project_id]
|
63
|
-
}
|
52
|
+
def pull_request
|
53
|
+
@pull_request ||= PullRequest.new(**pull_request_options)
|
64
54
|
end
|
65
55
|
|
66
56
|
# Executes `$ bundle update` for the rubocop and the associated gems
|
67
57
|
def update_rubocop!
|
68
|
-
bundler = Bundler::Command.new
|
58
|
+
bundler = Bundler::Command.new(verbose: options[:verbose])
|
69
59
|
pull_request.commit! ':police_car: $ bundle update rubocop' do
|
70
60
|
bundler.update(*RSPEC_GEMS)
|
71
61
|
end
|
@@ -79,10 +69,7 @@ module RubocopChallenger
|
|
79
69
|
def regenerate_rubocop_todo!
|
80
70
|
before_version = scan_rubocop_version_in_rubocop_todo_file
|
81
71
|
pull_request.commit! ':police_car: regenerate rubocop todo' do
|
82
|
-
Rubocop::Command.new.auto_gen_config(
|
83
|
-
exclude_limit: exclude_limit,
|
84
|
-
auto_gen_timestamp: auto_gen_timestamp
|
85
|
-
)
|
72
|
+
Rubocop::Command.new.auto_gen_config(**auto_gen_config_options)
|
86
73
|
end
|
87
74
|
after_version = scan_rubocop_version_in_rubocop_todo_file
|
88
75
|
|
@@ -107,7 +94,7 @@ module RubocopChallenger
|
|
107
94
|
# @raise [Errors::NoAutoCorrectableRule]
|
108
95
|
# Raises if there is no auto correctable rule in ".rubocop_todo.yml"
|
109
96
|
def rubocop_challenge!(before_version, after_version)
|
110
|
-
Rubocop::Challenge.exec(
|
97
|
+
Rubocop::Challenge.exec(**rubocop_challenge_options).tap do |rule|
|
111
98
|
pull_request.commit! ":police_car: #{rule.title}"
|
112
99
|
end
|
113
100
|
rescue Errors::NoAutoCorrectableRule => e
|
@@ -171,5 +158,33 @@ module RubocopChallenger
|
|
171
158
|
todo_reader = Rubocop::TodoReader.new(options[:file_path])
|
172
159
|
todo_reader.all_rules.include?(rule)
|
173
160
|
end
|
161
|
+
|
162
|
+
def rubocop_challenge_options
|
163
|
+
{
|
164
|
+
file_path: options[:file_path],
|
165
|
+
mode: options[:mode],
|
166
|
+
only_safe_auto_correct: options[:'only-safe-auto-correct']
|
167
|
+
}
|
168
|
+
end
|
169
|
+
|
170
|
+
def pull_request_options
|
171
|
+
{
|
172
|
+
user_name: options[:name],
|
173
|
+
user_email: options[:email],
|
174
|
+
base_branch: options[:base_branch],
|
175
|
+
labels: options[:labels],
|
176
|
+
dry_run: options[:'no-create-pr'],
|
177
|
+
project_column_name: options[:project_column_name],
|
178
|
+
project_id: options[:project_id],
|
179
|
+
verbose: options[:verbose]
|
180
|
+
}
|
181
|
+
end
|
182
|
+
|
183
|
+
def auto_gen_config_options
|
184
|
+
{
|
185
|
+
exclude_limit: options[:'exclude-limit'],
|
186
|
+
auto_gen_timestamp: options[:'auto-gen-timestamp']
|
187
|
+
}
|
188
|
+
end
|
174
189
|
end
|
175
190
|
end
|
@@ -21,12 +21,15 @@ module RubocopChallenger
|
|
21
21
|
# A target project ID. If does not supplied, this method will find a
|
22
22
|
# project which associated the repository. When the repository has
|
23
23
|
# multiple projects, you should supply this.
|
24
|
-
|
24
|
+
# @option verbose [Boolean]
|
25
|
+
# Displays executing command.
|
26
|
+
def initialize(user_name:, user_email:, **options) # rubocop:disable Metrics/MethodLength
|
25
27
|
@pr_comet = PrComet.new(
|
26
28
|
base: options[:base_branch],
|
27
29
|
branch: "rubocop-challenge/#{timestamp}",
|
28
30
|
user_name: user_name,
|
29
|
-
user_email: user_email
|
31
|
+
user_email: user_email,
|
32
|
+
verbose: options[:verbose]
|
30
33
|
)
|
31
34
|
@labels = options[:labels]
|
32
35
|
@dry_run = options[:dry_run]
|
@@ -90,7 +93,7 @@ module RubocopChallenger
|
|
90
93
|
project_id: project_id
|
91
94
|
}.merge(pr_comet_options)
|
92
95
|
|
93
|
-
pr_comet.create!(options) unless dry_run
|
96
|
+
pr_comet.create!(**options) unless dry_run
|
94
97
|
end
|
95
98
|
|
96
99
|
# @param before_version [String]
|
@@ -4,16 +4,17 @@ module RubocopChallenger
|
|
4
4
|
module Rubocop
|
5
5
|
# To execute Rubocop Challenge flow
|
6
6
|
class Challenge
|
7
|
-
def self.exec(file_path
|
8
|
-
new(file_path, mode).send(:exec)
|
7
|
+
def self.exec(file_path:, mode:, only_safe_auto_correct:)
|
8
|
+
new(file_path, mode, only_safe_auto_correct).send(:exec)
|
9
9
|
end
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
|
-
attr_reader :mode, :command, :todo_reader, :todo_writer
|
13
|
+
attr_reader :mode, :only_safe_auto_correct, :command, :todo_reader, :todo_writer
|
14
14
|
|
15
|
-
def initialize(file_path, mode)
|
15
|
+
def initialize(file_path, mode, only_safe_auto_correct)
|
16
16
|
@mode = mode
|
17
|
+
@only_safe_auto_correct = only_safe_auto_correct
|
17
18
|
@command = Rubocop::Command.new
|
18
19
|
@todo_reader = Rubocop::TodoReader.new(file_path)
|
19
20
|
@todo_writer = Rubocop::TodoWriter.new(file_path)
|
@@ -23,7 +24,7 @@ module RubocopChallenger
|
|
23
24
|
def exec
|
24
25
|
verify_target_rule
|
25
26
|
todo_writer.delete_rule(target_rule)
|
26
|
-
command.auto_correct
|
27
|
+
command.auto_correct(only_safe_auto_correct: only_safe_auto_correct)
|
27
28
|
target_rule
|
28
29
|
end
|
29
30
|
|
@@ -7,8 +7,12 @@ module RubocopChallenger
|
|
7
7
|
include PrComet::CommandLine
|
8
8
|
|
9
9
|
# Executes auto correction
|
10
|
-
def auto_correct
|
11
|
-
|
10
|
+
def auto_correct(only_safe_auto_correct:)
|
11
|
+
if only_safe_auto_correct
|
12
|
+
run('--auto-correct')
|
13
|
+
else
|
14
|
+
run('--auto-correct-all')
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
# Generates `.rubocop_todo.yml`
|
@@ -27,11 +27,9 @@ module RubocopChallenger
|
|
27
27
|
# Loads gems for YARDoc creation
|
28
28
|
def load_rspec_gems!
|
29
29
|
RSPEC_GEMS.each do |dependency|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
nil
|
34
|
-
end
|
30
|
+
require dependency
|
31
|
+
rescue LoadError
|
32
|
+
nil
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
@@ -54,11 +52,15 @@ module RubocopChallenger
|
|
54
52
|
end
|
55
53
|
|
56
54
|
def source_file_path
|
57
|
-
|
58
|
-
.
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
if Object.respond_to?(:const_source_location)
|
56
|
+
Object.const_source_location(cop_class.name).first
|
57
|
+
else
|
58
|
+
instance_methods
|
59
|
+
.map { |m| cop_class.instance_method(m).source_location }
|
60
|
+
.reject(&:nil?)
|
61
|
+
.map(&:first)
|
62
|
+
.first
|
63
|
+
end
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/templates/error.md.erb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Rubocop challenge!
|
2
2
|
|
3
|
+
[<%= title %>](<%= rubydoc_url %>)
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
3
7
|
Sorry! Something went wrong! :bow:
|
4
8
|
Please report bugs [here](https://github.com/ryz310/rubocop_challenger/issues/new?assignees=ryz310&labels=bug&template=bug_report.md) with following error information.
|
5
9
|
|
metadata
CHANGED
@@ -1,37 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_challenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryosuke_sato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pr_comet
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
|
19
|
+
version: 0.5.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
21
25
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
26
|
+
version: 0.5.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rainbow
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
23
34
|
type: :runtime
|
24
35
|
prerelease: false
|
25
36
|
version_requirements: !ruby/object:Gem::Requirement
|
26
37
|
requirements:
|
27
38
|
- - ">="
|
28
39
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0
|
30
|
-
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
31
46
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
47
|
+
version: '0.87'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.87'
|
33
55
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
56
|
+
name: rubocop-performance
|
35
57
|
requirement: !ruby/object:Gem::Requirement
|
36
58
|
requirements:
|
37
59
|
- - ">="
|
@@ -45,7 +67,7 @@ dependencies:
|
|
45
67
|
- !ruby/object:Gem::Version
|
46
68
|
version: '0'
|
47
69
|
- !ruby/object:Gem::Dependency
|
48
|
-
name: rubocop
|
70
|
+
name: rubocop-rails
|
49
71
|
requirement: !ruby/object:Gem::Requirement
|
50
72
|
requirements:
|
51
73
|
- - ">="
|
@@ -59,7 +81,7 @@ dependencies:
|
|
59
81
|
- !ruby/object:Gem::Version
|
60
82
|
version: '0'
|
61
83
|
- !ruby/object:Gem::Dependency
|
62
|
-
name: rubocop-
|
84
|
+
name: rubocop-rake
|
63
85
|
requirement: !ruby/object:Gem::Requirement
|
64
86
|
requirements:
|
65
87
|
- - ">="
|
@@ -118,16 +140,16 @@ dependencies:
|
|
118
140
|
name: bundler
|
119
141
|
requirement: !ruby/object:Gem::Requirement
|
120
142
|
requirements:
|
121
|
-
- - "
|
143
|
+
- - ">="
|
122
144
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
145
|
+
version: '2.0'
|
124
146
|
type: :development
|
125
147
|
prerelease: false
|
126
148
|
version_requirements: !ruby/object:Gem::Requirement
|
127
149
|
requirements:
|
128
|
-
- - "
|
150
|
+
- - ">="
|
129
151
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
152
|
+
version: '2.0'
|
131
153
|
- !ruby/object:Gem::Dependency
|
132
154
|
name: pry-byebug
|
133
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,16 +210,16 @@ dependencies:
|
|
188
210
|
name: simplecov
|
189
211
|
requirement: !ruby/object:Gem::Requirement
|
190
212
|
requirements:
|
191
|
-
- -
|
213
|
+
- - '='
|
192
214
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
215
|
+
version: 0.21.2
|
194
216
|
type: :development
|
195
217
|
prerelease: false
|
196
218
|
version_requirements: !ruby/object:Gem::Requirement
|
197
219
|
requirements:
|
198
|
-
- -
|
220
|
+
- - '='
|
199
221
|
- !ruby/object:Gem::Version
|
200
|
-
version:
|
222
|
+
version: 0.21.2
|
201
223
|
description: Make a clean your rubocop_todo.yml with CI
|
202
224
|
email:
|
203
225
|
- r-sato@feedforce.jp
|
@@ -207,13 +229,16 @@ extensions: []
|
|
207
229
|
extra_rdoc_files: []
|
208
230
|
files:
|
209
231
|
- ".circleci/config.yml"
|
232
|
+
- ".dependabot/config.yml"
|
210
233
|
- ".envrc.skeleton"
|
211
234
|
- ".gem_comet.yml"
|
212
235
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
213
236
|
- ".gitignore"
|
214
237
|
- ".rspec"
|
215
238
|
- ".rubocop.yml"
|
239
|
+
- ".rubocop_challenge.yml"
|
216
240
|
- ".rubocop_todo.yml"
|
241
|
+
- CHANGELOG.md
|
217
242
|
- CODE_OF_CONDUCT.md
|
218
243
|
- Gemfile
|
219
244
|
- Gemfile.lock
|
@@ -260,14 +285,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
285
|
requirements:
|
261
286
|
- - ">="
|
262
287
|
- !ruby/object:Gem::Version
|
263
|
-
version: '
|
288
|
+
version: '2.5'
|
264
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
265
290
|
requirements:
|
266
|
-
- - "
|
291
|
+
- - ">="
|
267
292
|
- !ruby/object:Gem::Version
|
268
|
-
version:
|
293
|
+
version: '0'
|
269
294
|
requirements: []
|
270
|
-
rubygems_version: 3.
|
295
|
+
rubygems_version: 3.2.3
|
271
296
|
signing_key:
|
272
297
|
specification_version: 4
|
273
298
|
summary: Make a clean your rubocop_todo.yml with CI
|