rubocop_challenger 2.1.0 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d097a5ea1b6b131558d645c7d5b89a9be3c53e632f933ae4fa3ce239a9ddac23
4
- data.tar.gz: b2a91d4b753a142d0f632816222a9c0e1257cc98a4dfd3948cade3aa1cbd370e
3
+ metadata.gz: a3a960d3fe4d206f4cc46209f87444ba12896451ed28a3d90fb166cd73c82823
4
+ data.tar.gz: 68a41f56882ec3c7256d47b4c0470fea111ea65f5904f7030b0790c998ba8331
5
5
  SHA512:
6
- metadata.gz: 6b1b6250da286f15506c6bcd700a9a5973a75e848ae34f71e653aef5f65733214e6b22e7cf06a104d993cfd13c4bcf4e231543ab5c0100cc7f4a1b6e16a20c45
7
- data.tar.gz: e4b3fed47b69d1247e713365d517188d87f5f97aadf5e9f67256e8b6c9b798c52eaf0c385018fccc08cfbf5c23e3cb8957c9980e7e97c460f7295a49091d60b2
6
+ metadata.gz: e1c137155a305fe02312079d18c38de44b52a3163a8c4748f1e813cb5d53551bbebb466ec6c15d142bc70ac2b36a850963919acaaab7e871e936c7324f43d02b
7
+ data.tar.gz: 1b1ffa7014dca47a0eb0e0bcadb2a19c7b08ddebaf18d4581090307804195f14d8dab98694079787c84ef2c9beaf7fa2c730b75ed51ea5a51c02931893e6acd3
data/.circleci/config.yml CHANGED
@@ -5,14 +5,14 @@
5
5
  version: 2.1
6
6
 
7
7
  orbs:
8
- ruby-orbs: sue445/ruby-orbs@1.6.1
8
+ ruby-orbs: sue445/ruby-orbs@1.6.2
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.5', '2.6', '2.7', '3.0', 'latest']
15
+ enum: ['2.6', '2.7', '3.0']
16
16
  default: '3.0'
17
17
 
18
18
  executors:
@@ -20,7 +20,7 @@ executors:
20
20
  parameters:
21
21
  <<: *ruby_version
22
22
  docker:
23
- - image: circleci/ruby:<< parameters.ruby_version >>
23
+ - image: cimg/ruby:<< parameters.ruby_version >>
24
24
  working_directory: ~/repo
25
25
 
26
26
  commands:
@@ -159,7 +159,7 @@ jobs:
159
159
  - code-climate/install
160
160
  - code-climate/sum-coverage:
161
161
  input: codeclimate.*.json
162
- parts: 5
162
+ parts: 3
163
163
  - code-climate/upload-coverage
164
164
  rubocop:
165
165
  executor: default
@@ -192,9 +192,6 @@ workflows:
192
192
 
193
193
  commit:
194
194
  jobs:
195
- - build:
196
- name: build_on_ruby_2.5
197
- ruby_version: '2.5'
198
195
  - build:
199
196
  name: build_on_ruby_2.6
200
197
  ruby_version: '2.6'
@@ -204,27 +201,20 @@ workflows:
204
201
  - build:
205
202
  name: build_on_ruby_3.0
206
203
  ruby_version: '3.0'
207
- - build:
208
- name: build_on_ruby_latest
209
- ruby_version: 'latest'
210
204
  - rubocop
211
205
  - yardoc
212
206
  - integration_testing
213
207
  - upload-coverage:
214
208
  requires:
215
- - build_on_ruby_2.5
216
209
  - build_on_ruby_2.6
217
210
  - build_on_ruby_2.7
218
211
  - build_on_ruby_3.0
219
- - build_on_ruby_latest
220
212
  - release:
221
213
  context: RubyGems API Key
222
214
  requires:
223
- - build_on_ruby_2.5
224
215
  - build_on_ruby_2.6
225
216
  - build_on_ruby_2.7
226
217
  - build_on_ruby_3.0
227
- - build_on_ruby_latest
228
218
  - rubocop
229
219
  filters:
230
220
  branches:
data/.gem_comet.yml CHANGED
@@ -1,12 +1,24 @@
1
1
  # [Usage]
2
2
  #
3
3
  # $ gem install gem_comet
4
+ # $ gem_comet init
4
5
  # $ gem_comet release {version number, like as "1.2.3"}
6
+ # $ gem_comet changelog
7
+ # $ gem_comet versions
5
8
 
6
- version: 1.1
9
+ version: 1.2
7
10
 
8
11
  release:
9
12
  base_branch: master
10
13
  release_branch: production
11
14
  version_file_path: lib/rubocop_challenger/version.rb
12
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
@@ -21,6 +21,7 @@ Add error message and backtrace if you can see.
21
21
  - rubocop-performance: [e.g. 1.2.3]
22
22
  - rubocop-rails: [e.g. 1.2.3]
23
23
  - rubocop-rspec: [e.g. 1.2.3]
24
+ - rubocop-thread_safety: [e.g. 1.2.3]
24
25
 
25
26
  **Additional context**
26
27
  Add any other context about the problem here.
@@ -0,0 +1,31 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "08:00"
8
+ timezone: Japan
9
+ open-pull-requests-limit: 10
10
+ reviewers:
11
+ - ryz310
12
+ assignees:
13
+ - ryz310
14
+ labels:
15
+ - dependabot
16
+ ignore:
17
+ - dependency-name: simplecov
18
+ versions:
19
+ - ">= 0.19.a, < 0.20"
20
+ - dependency-name: rubocop
21
+ versions:
22
+ - 1.10.0
23
+ - 1.11.0
24
+ - 1.12.0
25
+ - 1.12.1
26
+ - dependency-name: rubocop-performance
27
+ versions:
28
+ - 1.10.0
29
+ - dependency-name: rubocop-rspec
30
+ versions:
31
+ - 2.2.0
data/.rubocop.yml CHANGED
@@ -2,11 +2,12 @@ require:
2
2
  - rubocop-performance
3
3
  - rubocop-rake
4
4
  - rubocop-rspec
5
+ - rubocop-thread_safety
5
6
 
6
7
  inherit_from: .rubocop_todo.yml
7
8
 
8
9
  AllCops:
9
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 2.6
10
11
  NewCops: enable
11
12
 
12
13
  Metrics/BlockLength:
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 1.8.0.
3
+ # using RuboCop version 1.24.1.
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 CHANGED
@@ -1,5 +1,71 @@
1
1
  # Change log
2
2
 
3
+ ## v2.5.0 (Jan 18, 2022)
4
+
5
+ ### Feature
6
+
7
+ * [#566](https://github.com/ryz310/rubocop_challenger/pull/566) Support rubocop thread safety ([@ryz310](https://github.com/ryz310))
8
+
9
+ ### Rubocop Challenge
10
+
11
+ * [#554](https://github.com/ryz310/rubocop_challenger/pull/554) ryz310/rubocop-challenge/20211226233047 ([@ryz310](https://github.com/ryz310))
12
+ * [#555](https://github.com/ryz310/rubocop_challenger/pull/555) ryz310/rubocop-challenge/20211231233046 ([@ryz310](https://github.com/ryz310))
13
+
14
+ ### Dependabot
15
+
16
+ * [#556](https://github.com/ryz310/rubocop_challenger/pull/556) Bump rubocop-performance from 1.13.0 to 1.13.1 ([@ryz310](https://github.com/ryz310))
17
+ * [#561](https://github.com/ryz310/rubocop_challenger/pull/561) Bump rubocop-rails from 2.13.0 to 2.13.1 ([@ryz310](https://github.com/ryz310))
18
+ * [#560](https://github.com/ryz310/rubocop_challenger/pull/560) Bump rspec_junit_formatter from 0.4.1 to 0.5.1 ([@ryz310](https://github.com/ryz310))
19
+ * [#559](https://github.com/ryz310/rubocop_challenger/pull/559) ryz310/dependabot/bundler/thor-1.2.1 ([@ryz310](https://github.com/ryz310))
20
+ * [#562](https://github.com/ryz310/rubocop_challenger/pull/562) Bump rainbow from 3.0.0 to 3.1.1 ([@ryz310](https://github.com/ryz310))
21
+
22
+ ## v2.4.0 (Dec 26, 2021)
23
+
24
+ ### Feature
25
+
26
+ * [#550](https://github.com/ryz310/rubocop_challenger/pull/550) The end of ruby 2.5 support ([@ryz310](https://github.com/ryz310))
27
+
28
+ ### Rubocop Challenge
29
+
30
+ * [#544](https://github.com/ryz310/rubocop_challenger/pull/544) Gemspec/RequireMFA-20211115233051 ([@ryz310](https://github.com/ryz310))
31
+
32
+ ### Dependabot
33
+
34
+ * [#479](https://github.com/ryz310/rubocop_challenger/pull/479) ryz310/dependabot/bundler/rubocop-1.13.0 ([@ryz310](https://github.com/ryz310))
35
+ * [#482](https://github.com/ryz310/rubocop_challenger/pull/482) ryz310/dependabot/bundler/rubocop-rspec-2.3.0 ([@ryz310](https://github.com/ryz310))
36
+ * [#483](https://github.com/ryz310/rubocop_challenger/pull/483) ryz310/dependabot/add-v2-config-file ([@ryz310](https://github.com/ryz310))
37
+ * [#518](https://github.com/ryz310/rubocop_challenger/pull/518) Bump rake from 13.0.4 to 13.0.6 ([@ryz310](https://github.com/ryz310))
38
+ * [#537](https://github.com/ryz310/rubocop_challenger/pull/537) ryz310/dependabot/bundler/rubocop-rails-2.12.4 ([@ryz310](https://github.com/ryz310))
39
+ * [#542](https://github.com/ryz310/rubocop_challenger/pull/542) Bump addressable from 2.7.0 to 2.8.0 ([@ryz310](https://github.com/ryz310))
40
+ * [#543](https://github.com/ryz310/rubocop_challenger/pull/543) Bump rubocop-performance from 1.11.5 to 1.12.0 ([@ryz310](https://github.com/ryz310))
41
+ * [#546](https://github.com/ryz310/rubocop_challenger/pull/546) Bump yard from 0.9.26 to 0.9.27 ([@ryz310](https://github.com/ryz310))
42
+
43
+ ## v2.3.0 (Feb 23, 2021)
44
+
45
+ ### Feature
46
+
47
+ * [#465](https://github.com/ryz310/rubocop_challenger/pull/465) Add description whether the challenge is created by safe autocorrect or not ([@ryz310](https://github.com/ryz310))
48
+
49
+ ### Rubocop Challenge
50
+
51
+ * [#464](https://github.com/ryz310/rubocop_challenger/pull/464) Re-generate .rubocop_todo.yml with RuboCop v1.10.0 ([@ryz310](https://github.com/ryz310))
52
+
53
+ ### Dependabot
54
+
55
+ * [#453](https://github.com/ryz310/rubocop_challenger/pull/453) ryz310/dependabot/bundler/thor-1.1.0 ([@ryz310](https://github.com/ryz310))
56
+ * [#457](https://github.com/ryz310/rubocop_challenger/pull/457) ryz310/dependabot/bundler/rubocop-1.9.1 ([@ryz310](https://github.com/ryz310))
57
+ * [#461](https://github.com/ryz310/rubocop_challenger/pull/461) Update ruby-orbs orb to v1.6.2 ([@ryz310](https://github.com/ryz310))
58
+
59
+ ## v2.2.0 (Jan 11, 2021)
60
+
61
+ ### Feature
62
+
63
+ * [#449](https://github.com/ryz310/rubocop_challenger/pull/449) Add verbose option ([@ryz310](https://github.com/ryz310))
64
+
65
+ ### Dependabot
66
+
67
+ * [#447](https://github.com/ryz310/rubocop_challenger/pull/447) ryz310/dependabot/bundler/rubocop-1.8.1 ([@ryz310](https://github.com/ryz310))
68
+
3
69
  ## v2.1.0 (Jan 11, 2021)
4
70
 
5
71
  ### Feature
data/Gemfile CHANGED
@@ -4,5 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
+ gem 'activesupport', '~> 6.1' # TODO: Remove this line at the end of Ruby 2.6 support
8
+
7
9
  # Specify your gem's dependencies in rubocop_challenger.gemspec
8
10
  gemspec
data/Gemfile.lock CHANGED
@@ -1,51 +1,70 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_challenger (2.1.0)
5
- pr_comet (~> 0.4.0)
4
+ rubocop_challenger (2.5.0)
5
+ pr_comet (~> 0.5.1)
6
6
  rainbow
7
7
  rubocop (>= 0.87)
8
8
  rubocop-performance
9
9
  rubocop-rails
10
10
  rubocop-rake
11
11
  rubocop-rspec
12
+ rubocop-thread_safety
12
13
  thor
13
14
  yard
14
15
 
15
16
  GEM
16
17
  remote: https://rubygems.org/
17
18
  specs:
18
- activesupport (6.1.1)
19
+ activesupport (6.1.4.4)
19
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
21
  i18n (>= 1.6, < 2)
21
22
  minitest (>= 5.1)
22
23
  tzinfo (~> 2.0)
23
24
  zeitwerk (~> 2.3)
24
- addressable (2.7.0)
25
+ addressable (2.8.0)
25
26
  public_suffix (>= 2.0.2, < 5.0)
26
- ast (2.4.1)
27
+ ast (2.4.2)
27
28
  byebug (11.1.3)
28
29
  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)
30
+ concurrent-ruby (1.1.9)
31
+ diff-lcs (1.5.0)
32
+ docile (1.4.0)
33
+ faraday (1.9.3)
34
+ faraday-em_http (~> 1.0)
35
+ faraday-em_synchrony (~> 1.0)
36
+ faraday-excon (~> 1.1)
37
+ faraday-httpclient (~> 1.0)
38
+ faraday-multipart (~> 1.0)
33
39
  faraday-net_http (~> 1.0)
40
+ faraday-net_http_persistent (~> 1.0)
41
+ faraday-patron (~> 1.0)
42
+ faraday-rack (~> 1.0)
43
+ faraday-retry (~> 1.0)
44
+ ruby2_keywords (>= 0.0.4)
45
+ faraday-em_http (1.0.0)
46
+ faraday-em_synchrony (1.0.0)
47
+ faraday-excon (1.1.0)
48
+ faraday-httpclient (1.0.1)
49
+ faraday-multipart (1.0.3)
34
50
  multipart-post (>= 1.2, < 3)
35
- ruby2_keywords
36
- faraday-net_http (1.0.0)
37
- i18n (1.8.7)
51
+ faraday-net_http (1.0.1)
52
+ faraday-net_http_persistent (1.2.0)
53
+ faraday-patron (1.0.0)
54
+ faraday-rack (1.0.0)
55
+ faraday-retry (1.0.3)
56
+ i18n (1.8.11)
38
57
  concurrent-ruby (~> 1.0)
39
58
  method_source (1.0.0)
40
- minitest (5.14.3)
59
+ minitest (5.15.0)
41
60
  multipart-post (2.1.1)
42
- octokit (4.20.0)
61
+ octokit (4.22.0)
43
62
  faraday (>= 0.9)
44
63
  sawyer (~> 0.8.0, >= 0.5.3)
45
- parallel (1.20.1)
46
- parser (3.0.0.0)
64
+ parallel (1.21.0)
65
+ parser (3.1.0.0)
47
66
  ast (~> 2.4.1)
48
- pr_comet (0.4.0)
67
+ pr_comet (0.5.1)
49
68
  octokit
50
69
  rainbow
51
70
  pry (0.13.1)
@@ -56,50 +75,51 @@ GEM
56
75
  pry (~> 0.13.0)
57
76
  public_suffix (4.0.6)
58
77
  rack (2.2.3)
59
- rainbow (3.0.0)
60
- rake (13.0.3)
61
- regexp_parser (2.0.3)
62
- rexml (3.2.4)
78
+ rainbow (3.1.1)
79
+ rake (13.0.6)
80
+ regexp_parser (2.2.0)
81
+ rexml (3.2.5)
63
82
  rspec (3.10.0)
64
83
  rspec-core (~> 3.10.0)
65
84
  rspec-expectations (~> 3.10.0)
66
85
  rspec-mocks (~> 3.10.0)
67
86
  rspec-core (3.10.1)
68
87
  rspec-support (~> 3.10.0)
69
- rspec-expectations (3.10.1)
88
+ rspec-expectations (3.10.2)
70
89
  diff-lcs (>= 1.2.0, < 2.0)
71
90
  rspec-support (~> 3.10.0)
72
- rspec-mocks (3.10.1)
91
+ rspec-mocks (3.10.2)
73
92
  diff-lcs (>= 1.2.0, < 2.0)
74
93
  rspec-support (~> 3.10.0)
75
- rspec-support (3.10.1)
76
- rspec_junit_formatter (0.4.1)
94
+ rspec-support (3.10.3)
95
+ rspec_junit_formatter (0.5.1)
77
96
  rspec-core (>= 2, < 4, != 2.12.0)
78
- rubocop (1.8.0)
97
+ rubocop (1.25.0)
79
98
  parallel (~> 1.10)
80
- parser (>= 3.0.0.0)
99
+ parser (>= 3.1.0.0)
81
100
  rainbow (>= 2.2.2, < 4.0)
82
101
  regexp_parser (>= 1.8, < 3.0)
83
102
  rexml
84
- rubocop-ast (>= 1.2.0, < 2.0)
103
+ rubocop-ast (>= 1.15.1, < 2.0)
85
104
  ruby-progressbar (~> 1.7)
86
105
  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)
106
+ rubocop-ast (1.15.1)
107
+ parser (>= 3.0.1.1)
108
+ rubocop-performance (1.13.2)
109
+ rubocop (>= 1.7.0, < 2.0)
91
110
  rubocop-ast (>= 0.4.0)
92
- rubocop-rails (2.9.1)
111
+ rubocop-rails (2.13.2)
93
112
  activesupport (>= 4.2.0)
94
113
  rack (>= 1.1)
95
- rubocop (>= 0.90.0, < 2.0)
96
- rubocop-rake (0.5.1)
97
- rubocop
98
- rubocop-rspec (2.1.0)
114
+ rubocop (>= 1.7.0, < 2.0)
115
+ rubocop-rake (0.6.0)
99
116
  rubocop (~> 1.0)
100
- rubocop-ast (>= 1.1.0)
117
+ rubocop-rspec (2.7.0)
118
+ rubocop (~> 1.19)
119
+ rubocop-thread_safety (0.4.4)
120
+ rubocop (>= 0.53.0)
101
121
  ruby-progressbar (1.11.0)
102
- ruby2_keywords (0.0.2)
122
+ ruby2_keywords (0.0.5)
103
123
  sawyer (0.8.2)
104
124
  addressable (>= 2.3.5)
105
125
  faraday (> 0.8, < 2.0)
@@ -108,18 +128,21 @@ GEM
108
128
  simplecov-html (~> 0.11)
109
129
  simplecov_json_formatter (~> 0.1)
110
130
  simplecov-html (0.12.3)
111
- simplecov_json_formatter (0.1.2)
112
- thor (1.0.1)
131
+ simplecov_json_formatter (0.1.3)
132
+ thor (1.2.1)
113
133
  tzinfo (2.0.4)
114
134
  concurrent-ruby (~> 1.0)
115
- unicode-display_width (2.0.0)
116
- yard (0.9.26)
117
- zeitwerk (2.4.2)
135
+ unicode-display_width (2.1.0)
136
+ webrick (1.7.0)
137
+ yard (0.9.27)
138
+ webrick (~> 1.7.0)
139
+ zeitwerk (2.5.3)
118
140
 
119
141
  PLATFORMS
120
142
  ruby
121
143
 
122
144
  DEPENDENCIES
145
+ activesupport (~> 6.1)
123
146
  bundler (>= 2.0)
124
147
  pry-byebug
125
148
  rake (~> 13.0)
@@ -129,4 +152,4 @@ DEPENDENCIES
129
152
  simplecov (= 0.21.2)
130
153
 
131
154
  BUNDLED WITH
132
- 2.2.3
155
+ 2.2.32
data/README.md CHANGED
@@ -25,27 +25,7 @@ be continued to evolve.
25
25
 
26
26
  ## Usage
27
27
 
28
- ### 1. Edit your Gemfile
29
-
30
- If you do not specify the version of `rubocop` gem so you do not have to add `rubocop_challenger` gem in your Gemfile (**Recommended**).
31
-
32
- If you specify the version so put this line in your Gemfile.
33
-
34
- ```rb
35
- gem 'rubocop_challenger', group: :development, require: false
36
- ```
37
-
38
- ### 2. Setting GitHub personal access token
39
-
40
- GitHub personal access token is required for sending pull requests to your repository.
41
-
42
- 1. Go to [your account's settings page](https://github.com/settings/tokens) and [generate a new token](https://github.com/settings/tokens/new) with "repo" scope
43
- ![generate token](images/generate_token.png)
44
- 1. On [CircleCI](https://circleci.com) dashboard, go to your application's "Project Settings" -> "Environment Variables"
45
- 1. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
46
- ![circleci environment variables](images/circleci_environment_variables.png)
47
-
48
- ### 3. Configure .circleci/config.yml
28
+ ### 1. Configure .circleci/config.yml
49
29
 
50
30
  Configure your `.circleci/config.yml` to run rubocop_challenger, for example:
51
31
 
@@ -56,7 +36,7 @@ version: 2
56
36
  jobs:
57
37
  rubocop_challenge:
58
38
  docker:
59
- - image: circleci/ruby:2.6-node-browsers
39
+ - image: circleci/ruby:3.0
60
40
  working_directory: ~/repo
61
41
  steps:
62
42
  - checkout
@@ -83,19 +63,24 @@ workflows:
83
63
  - rubocop_challenge
84
64
  ```
85
65
 
86
- If you added `rubocop_challenger` gem in your Gemfile so please modify script of installing and execution as following:
66
+ **Should not append `gem 'rubocop_challenger'` on your Gemfile.**
67
+ I have seen cases where errors occur due to compatibility issues with other gems.
87
68
 
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
- ```
69
+ ### 2. Setting GitHub personal access token
70
+
71
+ GitHub personal access token is required for sending pull requests to your repository.
72
+
73
+ 1. Go to [your account's settings page](https://github.com/settings/tokens) and [generate a new token](https://github.com/settings/tokens/new) with "repo" scope
74
+ ![generate token](images/generate_token.png)
75
+ 1. On [CircleCI](https://circleci.com) dashboard, go to your application's "Project Settings" -> "Environment Variables"
76
+ 1. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
77
+ ![circleci environment variables](images/circleci_environment_variables.png)
78
+
79
+ ### Want to use on GitHub Actions?
80
+
81
+ It's introduced in the following blog. Thank you Mr. Takuya Yamaguchi!
82
+
83
+ See: [RuboCop ChallengerをGitHub Actionsで動かす](https://zenn.dev/yamat47/articles/219e14ebcf31a1d13ff4)
99
84
 
100
85
  ## CLI command references
101
86
 
@@ -117,30 +102,32 @@ Usage:
117
102
  rubocop_challenger go --email=EMAIL --name=NAME
118
103
 
119
104
  Options:
120
- --email=EMAIL # The Pull Request committer email
121
- --name=NAME # The Pull Request committer name
122
- f, [--file-path=FILE_PATH] # Set your ".rubocop_todo.yml" path
123
- # Default: .rubocop_todo.yml
124
- 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.
125
- [--mode=MODE] # Mode to select deletion target. You can choice "most_occurrence", "least_occurrence", or "random"
126
- # Default: most_occurrence
127
- b, [--base-branch=BASE_BRANCH] # The Branch to merge into
128
- # Default: master
129
- l, [--labels=one two three] # Label to give to Pull Request
130
- # Default: ["rubocop challenge"]
131
- [--project-column-name=PROJECT_COLUMN_NAME] # A project column name. You can add the created PR to the GitHub project
132
- [--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.
133
- [--no-create-pr] # No create a pull request (for testing)
134
- [--exclude-limit=N] # For how many exclude properties when creating the .rubocop_todo.yml
135
- [--auto-gen-timestamp], [--no-auto-gen-timestamp] # Include the date and time when creating the .rubocop_todo.yml
136
- # Default: true
105
+ --email=EMAIL # The Pull Request committer email
106
+ --name=NAME # The Pull Request committer name
107
+ f, [--file-path=FILE_PATH] # Set your ".rubocop_todo.yml" path
108
+ # Default: .rubocop_todo.yml
109
+ 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.
110
+ [--mode=MODE] # Mode to select deletion target. You can choice "most_occurrence", "least_occurrence", or "random"
111
+ # Default: most_occurrence
112
+ b, [--base-branch=BASE_BRANCH] # The Branch to merge into
113
+ # Default: master
114
+ l, [--labels=one two three] # Label to give to Pull Request
115
+ # Default: ["rubocop challenge"]
116
+ [--project-column-name=PROJECT_COLUMN_NAME] # A project column name. You can add the created PR to the GitHub project
117
+ [--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.
118
+ [--no-create-pr] # No create a pull request (for testing)
119
+ [--exclude-limit=N] # For how many exclude properties when creating the .rubocop_todo.yml
120
+ [--auto-gen-timestamp], [--no-auto-gen-timestamp] # Include the date and time when creating the .rubocop_todo.yml
121
+ # Default: true
122
+ [--only-safe-auto-correct], [--no-only-safe-auto-correct] # If given `true`, it executes `rubocop --auto-correct`,it means to correct safe cops only.
123
+ [--verbose], [--no-verbose] # Displays executing command.
137
124
 
138
125
  Run `$ rubocop --auto-correct` and create a PR to GitHub repo
139
126
  ```
140
127
 
141
128
  ## Requirement
142
129
 
143
- * Ruby 2.5 or higher
130
+ * Ruby 2.6 or higher
144
131
 
145
132
  ## Development
146
133
 
data/challenger.gemspec CHANGED
@@ -22,15 +22,16 @@ 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.required_ruby_version = '>= 2.5'
25
+ spec.required_ruby_version = '>= 2.6'
26
26
 
27
- spec.add_runtime_dependency 'pr_comet', '~> 0.4.0'
27
+ spec.add_runtime_dependency 'pr_comet', '~> 0.5.1'
28
28
  spec.add_runtime_dependency 'rainbow'
29
29
  spec.add_runtime_dependency 'rubocop', '>= 0.87'
30
30
  spec.add_runtime_dependency 'rubocop-performance'
31
31
  spec.add_runtime_dependency 'rubocop-rails'
32
32
  spec.add_runtime_dependency 'rubocop-rake'
33
33
  spec.add_runtime_dependency 'rubocop-rspec'
34
+ spec.add_runtime_dependency 'rubocop-thread_safety'
34
35
  spec.add_runtime_dependency 'thor'
35
36
  spec.add_runtime_dependency 'yard'
36
37
 
@@ -40,4 +41,7 @@ Gem::Specification.new do |spec|
40
41
  spec.add_development_dependency 'rspec'
41
42
  spec.add_development_dependency 'rspec_junit_formatter'
42
43
  spec.add_development_dependency 'simplecov', '0.21.2'
44
+ spec.metadata = {
45
+ 'rubygems_mfa_required' => 'true'
46
+ }
43
47
  end
@@ -6,6 +6,10 @@ 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
@@ -66,6 +66,10 @@ module RubocopChallenger
66
66
  default: false,
67
67
  desc: 'If given `true`, it executes `rubocop --auto-correct`,' \
68
68
  'it means to correct safe cops only.'
69
+ option :verbose,
70
+ type: :boolean,
71
+ default: false,
72
+ desc: 'Displays executing command.'
69
73
  def go
70
74
  Go.new(options).exec
71
75
  rescue Errors::NoAutoCorrectableRule => e
@@ -14,13 +14,13 @@ module RubocopChallenger
14
14
 
15
15
  def generate
16
16
  <<~TEMPLATE
17
- #{ERB.new(template, nil, '-').result(binding)}
17
+ #{ERB.new(template, trim_mode: '-').result(binding)}
18
18
  #{FOOTER_TEXT}
19
19
  TEMPLATE
20
20
  rescue StandardError => e
21
21
  error_template = File.read(error_template_path)
22
22
  <<~TEMPLATE
23
- #{ERB.new(error_template, nil, '-').result(binding)}
23
+ #{ERB.new(error_template, trim_mode: '-').result(binding)}
24
24
  #{FOOTER_TEXT}
25
25
  TEMPLATE
26
26
  end
@@ -53,6 +53,10 @@ module RubocopChallenger
53
53
  yardoc.examples
54
54
  end
55
55
 
56
+ def safe_autocorrect?
57
+ yardoc.safe_autocorrect?
58
+ end
59
+
56
60
  def yardoc
57
61
  @yardoc ||= Rubocop::Yardoc.new(title)
58
62
  end
@@ -26,6 +26,8 @@ module RubocopChallenger
26
26
  # A target project ID. If does not supplied, this method will find a
27
27
  # project which associated the repository. When the repository has
28
28
  # multiple projects, you should supply this.
29
+ # @option verbose [Boolean]
30
+ # Displays executing command.
29
31
  def initialize(options)
30
32
  @options = options
31
33
  end
@@ -53,7 +55,7 @@ module RubocopChallenger
53
55
 
54
56
  # Executes `$ bundle update` for the rubocop and the associated gems
55
57
  def update_rubocop!
56
- bundler = Bundler::Command.new
58
+ bundler = Bundler::Command.new(verbose: options[:verbose])
57
59
  pull_request.commit! ':police_car: $ bundle update rubocop' do
58
60
  bundler.update(*RSPEC_GEMS)
59
61
  end
@@ -173,7 +175,8 @@ module RubocopChallenger
173
175
  labels: options[:labels],
174
176
  dry_run: options[:'no-create-pr'],
175
177
  project_column_name: options[:project_column_name],
176
- project_id: options[:project_id]
178
+ project_id: options[:project_id],
179
+ verbose: options[:verbose]
177
180
  }
178
181
  end
179
182
 
@@ -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
- def initialize(user_name:, user_email:, **options)
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]
@@ -4,12 +4,10 @@ module RubocopChallenger
4
4
  module Rubocop
5
5
  # To read YARD style documentation from rubocop gem source code
6
6
  class Yardoc
7
- def initialize(title)
7
+ def initialize(cop)
8
8
  load_rspec_gems!
9
- @cop_class = find_cop_class(title)
10
- YARD.parse(source_file_path)
11
- @yardoc = YARD::Registry.all(:class).first
12
- YARD::Registry.clear
9
+ @cop_class = find_cop_class(cop)
10
+ load_yardoc!
13
11
  end
14
12
 
15
13
  def description
@@ -20,6 +18,15 @@ module RubocopChallenger
20
18
  yardoc.tags('example').map { |tag| [tag.name, tag.text] }
21
19
  end
22
20
 
21
+ # Indicates whether the auto-correct a cop does is safe (equivalent) by design.
22
+ # If a cop is unsafe its auto-correct automatically becomes unsafe as well.
23
+ #
24
+ # @return [Boolean]
25
+ def safe_autocorrect?
26
+ config = RuboCop::ConfigLoader.default_configuration
27
+ cop_class.new(config).safe_autocorrect?
28
+ end
29
+
23
30
  private
24
31
 
25
32
  attr_reader :cop_class, :yardoc
@@ -36,12 +43,19 @@ module RubocopChallenger
36
43
  # Find a RuboCop class by cop name. It find from rubocop/rspec if cannot
37
44
  # find any class from rubocop gem.
38
45
  #
39
- # @param cop_name [String] The target cop name
40
- # @return [Class] Found RuboCop class
41
- def find_cop_class(cop_name)
42
- Object.const_get("RuboCop::Cop::#{cop_name.sub('/', '::')}")
46
+ # @param cop [String] The target cop name (e.g. "Performance/Size")
47
+ # @return [RuboCop::Cop] Found a RuboCop::Cop class
48
+ def find_cop_class(cop)
49
+ Object.const_get("RuboCop::Cop::#{cop.sub('/', '::')}")
43
50
  rescue NameError
44
- Object.const_get("RuboCop::Cop::RSpec::#{cop_name.sub('/', '::')}")
51
+ Object.const_get("RuboCop::Cop::RSpec::#{cop.sub('/', '::')}")
52
+ end
53
+
54
+ # Loads yardoc from the RuboCop::Cop class file
55
+ def load_yardoc!
56
+ YARD.parse(source_file_path)
57
+ @yardoc = YARD::Registry.all(:class).first
58
+ YARD::Registry.clear
45
59
  end
46
60
 
47
61
  def instance_methods
@@ -57,7 +71,7 @@ module RubocopChallenger
57
71
  else
58
72
  instance_methods
59
73
  .map { |m| cop_class.instance_method(m).source_location }
60
- .reject(&:nil?)
74
+ .compact
61
75
  .map(&:first)
62
76
  .first
63
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopChallenger
4
- VERSION = '2.1.0'
4
+ VERSION = '2.5.0'
5
5
  end
@@ -26,5 +26,6 @@ module RubocopChallenger
26
26
  rubocop-rails
27
27
  rubocop-rake
28
28
  rubocop-rspec
29
+ rubocop-thread_safety
29
30
  ].freeze
30
31
  end
@@ -2,6 +2,14 @@
2
2
 
3
3
  [<%= title %>](<%= rubydoc_url %>)
4
4
 
5
+ <% if safe_autocorrect? -%>
6
+ **Safe autocorrect: true**
7
+ :white_check_mark: The auto-correct a cop does is safe (equivalent) by design.
8
+ <% else -%>
9
+ **Safe autocorrect: false**
10
+ :warning: The auto-correct a cop can yield false positives by design.
11
+ <% end -%>
12
+
5
13
  ## Description
6
14
 
7
15
  > ### Overview
@@ -2,6 +2,14 @@
2
2
 
3
3
  [<%= title %>](<%= rubydoc_url %>)
4
4
 
5
+ <% if safe_autocorrect? -%>
6
+ **Safe autocorrect: true**
7
+ :white_check_mark: The auto-correct a cop does is safe (equivalent) by design.
8
+ <% else -%>
9
+ **Safe autocorrect: false**
10
+ :warning: The auto-correct a cop can yield false positives by design.
11
+ <% end -%>
12
+
5
13
  ## Description
6
14
 
7
15
  > ### Overview
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Description
6
6
 
7
- Sorry! Something went wrong! :bow:
7
+ Failed to create the cop description.
8
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.
9
9
 
10
10
  ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_challenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.5.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: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pr_comet
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.0
19
+ version: 0.5.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.0
26
+ version: 0.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rainbow
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-thread_safety
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: thor
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -229,10 +243,10 @@ extensions: []
229
243
  extra_rdoc_files: []
230
244
  files:
231
245
  - ".circleci/config.yml"
232
- - ".dependabot/config.yml"
233
246
  - ".envrc.skeleton"
234
247
  - ".gem_comet.yml"
235
248
  - ".github/ISSUE_TEMPLATE/bug_report.md"
249
+ - ".github/dependabot.yml"
236
250
  - ".gitignore"
237
251
  - ".rspec"
238
252
  - ".rubocop.yml"
@@ -276,7 +290,8 @@ files:
276
290
  homepage: https://github.com/ryz310/rubocop_challenger
277
291
  licenses:
278
292
  - MIT
279
- metadata: {}
293
+ metadata:
294
+ rubygems_mfa_required: 'true'
280
295
  post_install_message:
281
296
  rdoc_options: []
282
297
  require_paths:
@@ -285,14 +300,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
285
300
  requirements:
286
301
  - - ">="
287
302
  - !ruby/object:Gem::Version
288
- version: '2.5'
303
+ version: '2.6'
289
304
  required_rubygems_version: !ruby/object:Gem::Requirement
290
305
  requirements:
291
306
  - - ">="
292
307
  - !ruby/object:Gem::Version
293
308
  version: '0'
294
309
  requirements: []
295
- rubygems_version: 3.2.3
310
+ rubygems_version: 3.2.32
296
311
  signing_key:
297
312
  specification_version: 4
298
313
  summary: Make a clean your rubocop_todo.yml with CI
@@ -1,18 +0,0 @@
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"