rubocop_challenger 2.0.0.pre7 → 2.0.0.pre8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gem_comet.yml +6 -0
- data/.rubocop_todo.yml +2 -2
- data/Gemfile.lock +5 -5
- data/lib/rubocop_challenger.rb +7 -8
- data/lib/rubocop_challenger/go.rb +1 -4
- data/lib/rubocop_challenger/rubocop/challenge.rb +1 -1
- data/lib/rubocop_challenger/rubocop/yardoc.rb +12 -0
- data/lib/rubocop_challenger/version.rb +1 -1
- metadata +3 -3
- data/bin/release +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a23224fddbe8926bf666b3c64dd3d06a2f465869971f3cf33410f354cb50e6
|
4
|
+
data.tar.gz: ca85681e5c1f2f851fb49e02aa0f72ef69708b4adb5e46a8760b0912bae6e31c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88e6ffd5764d5e073622a7e92c789226e5ea3b00010f53d1869193707cfc36d072b791432cbaaec21408559768eb5544d5bc436064a9501078dbc4f2e86bf148
|
7
|
+
data.tar.gz: 21a413f9277576b1e0c745e712c108a1e4087a78937ad20164a32dac00cff7eefad0000c68021616f026df11aeb4415f1c5de21faf57faf08c79405a58a0ae3f
|
data/.gem_comet.yml
ADDED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
#
|
2
|
+
# `rubocop --auto-gen-config --exclude-limit 30 --no-auto-gen-timestamp`
|
3
|
+
# using RuboCop version 0.74.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/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop_challenger (2.0.0.
|
4
|
+
rubocop_challenger (2.0.0.pre8)
|
5
5
|
pr_comet (~> 0.2.0)
|
6
6
|
rainbow
|
7
7
|
rubocop
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
parallel (1.17.0)
|
32
32
|
parser (2.6.3.0)
|
33
33
|
ast (~> 2.4.0)
|
34
|
-
pr_comet (0.2.
|
34
|
+
pr_comet (0.2.1)
|
35
35
|
octokit
|
36
36
|
rainbow
|
37
37
|
pry (0.12.2)
|
@@ -58,16 +58,16 @@ GEM
|
|
58
58
|
rspec-support (3.8.2)
|
59
59
|
rspec_junit_formatter (0.4.1)
|
60
60
|
rspec-core (>= 2, < 4, != 2.12.0)
|
61
|
-
rubocop (0.
|
61
|
+
rubocop (0.74.0)
|
62
62
|
jaro_winkler (~> 1.5.1)
|
63
63
|
parallel (~> 1.10)
|
64
64
|
parser (>= 2.6)
|
65
65
|
rainbow (>= 2.2.2, < 4.0)
|
66
66
|
ruby-progressbar (~> 1.7)
|
67
67
|
unicode-display_width (>= 1.4.0, < 1.7)
|
68
|
-
rubocop-performance (1.4.
|
68
|
+
rubocop-performance (1.4.1)
|
69
69
|
rubocop (>= 0.71.0)
|
70
|
-
rubocop-rspec (1.
|
70
|
+
rubocop-rspec (1.35.0)
|
71
71
|
rubocop (>= 0.60.0)
|
72
72
|
ruby-progressbar (1.10.1)
|
73
73
|
sawyer (0.8.2)
|
data/lib/rubocop_challenger.rb
CHANGED
@@ -4,7 +4,6 @@ require 'erb'
|
|
4
4
|
require 'yard'
|
5
5
|
require 'rainbow'
|
6
6
|
require 'pr_comet'
|
7
|
-
require 'rubocop'
|
8
7
|
require 'rubocop_challenger/errors'
|
9
8
|
require 'rubocop_challenger/version'
|
10
9
|
require 'rubocop_challenger/rubocop/rule'
|
@@ -20,11 +19,11 @@ require 'rubocop_challenger/cli'
|
|
20
19
|
require 'rubocop_challenger/bundler/command'
|
21
20
|
require 'rubocop_challenger/github/pr_template'
|
22
21
|
|
23
|
-
|
24
|
-
%w[
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
module RubocopChallenger
|
23
|
+
RSPEC_GEMS = %w[
|
24
|
+
rubocop
|
25
|
+
rubocop-performance
|
26
|
+
rubocop-rails
|
27
|
+
rubocop-rspec
|
28
|
+
].freeze
|
30
29
|
end
|
@@ -67,10 +67,7 @@ module RubocopChallenger
|
|
67
67
|
def update_rubocop!
|
68
68
|
bundler = Bundler::Command.new
|
69
69
|
pull_request.commit! ':police_car: $ bundle update rubocop' do
|
70
|
-
bundler.update
|
71
|
-
'rubocop-performance',
|
72
|
-
'rubocop-rails',
|
73
|
-
'rubocop-rspec'
|
70
|
+
bundler.update(*RSPEC_GEMS)
|
74
71
|
end
|
75
72
|
end
|
76
73
|
|
@@ -14,7 +14,7 @@ module RubocopChallenger
|
|
14
14
|
|
15
15
|
def initialize(file_path, mode)
|
16
16
|
@mode = mode
|
17
|
-
@command
|
17
|
+
@command = Rubocop::Command.new
|
18
18
|
@todo_reader = Rubocop::TodoReader.new(file_path)
|
19
19
|
@todo_writer = Rubocop::TodoWriter.new(file_path)
|
20
20
|
end
|
@@ -5,6 +5,7 @@ module RubocopChallenger
|
|
5
5
|
# To read YARD style documentation from rubocop gem source code
|
6
6
|
class Yardoc
|
7
7
|
def initialize(title)
|
8
|
+
load_rspec_gems!
|
8
9
|
@cop_class = find_cop_class(title)
|
9
10
|
YARD.parse(source_file_path)
|
10
11
|
@yardoc = YARD::Registry.all(:class).first
|
@@ -23,6 +24,17 @@ module RubocopChallenger
|
|
23
24
|
|
24
25
|
attr_reader :cop_class, :yardoc
|
25
26
|
|
27
|
+
# Loads gems for YARDoc creation
|
28
|
+
def load_rspec_gems!
|
29
|
+
RSPEC_GEMS.each do |dependency|
|
30
|
+
begin
|
31
|
+
require dependency
|
32
|
+
rescue LoadError
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
26
38
|
# Find a RuboCop class by cop name. It find from rubocop/rspec if cannot
|
27
39
|
# find any class from rubocop gem.
|
28
40
|
#
|
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.0.0.
|
4
|
+
version: 2.0.0.pre8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryosuke_sato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pr_comet
|
@@ -202,6 +202,7 @@ extra_rdoc_files: []
|
|
202
202
|
files:
|
203
203
|
- ".circleci/config.yml"
|
204
204
|
- ".envrc.skeleton"
|
205
|
+
- ".gem_comet.yml"
|
205
206
|
- ".gitignore"
|
206
207
|
- ".rspec"
|
207
208
|
- ".rubocop.yml"
|
@@ -214,7 +215,6 @@ files:
|
|
214
215
|
- Rakefile
|
215
216
|
- bin/console
|
216
217
|
- bin/jailbreak
|
217
|
-
- bin/release
|
218
218
|
- bin/setup
|
219
219
|
- challenger.gemspec
|
220
220
|
- exe/rubocop_challenger
|
data/bin/release
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
# usage: bin/release VERSION
|
5
|
-
|
6
|
-
require 'bundler/setup'
|
7
|
-
require 'rubocop_challenger'
|
8
|
-
|
9
|
-
VERSION_FORMAT = /\A\d+\.\d+\.\d+(\.(pre|beta|rc)\d?)?\z/.freeze
|
10
|
-
version = ARGV[0]
|
11
|
-
rubocop = RubocopChallenger::Rubocop::Command.new
|
12
|
-
pr_comet = PrComet.new(base: 'master', branch: "update/v#{version}")
|
13
|
-
|
14
|
-
# Verifying
|
15
|
-
abort 'usage: bin/release VERSION' if version.nil?
|
16
|
-
abort 'A version must be like a `1.2.3`' unless version =~ VERSION_FORMAT
|
17
|
-
|
18
|
-
# Modify a version file
|
19
|
-
pr_comet.commit 'Update version' do
|
20
|
-
File.write('lib/rubocop_challenger/version.rb', <<~VERSION)
|
21
|
-
# frozen_string_literal: true
|
22
|
-
|
23
|
-
module RubocopChallenger
|
24
|
-
VERSION = '#{version}'
|
25
|
-
end
|
26
|
-
VERSION
|
27
|
-
end
|
28
|
-
|
29
|
-
# Bundle Update
|
30
|
-
pr_comet.commit 'Run $ bundle update' do
|
31
|
-
`bundle update`
|
32
|
-
end
|
33
|
-
|
34
|
-
# Regenerate .rubocop_todo.yml
|
35
|
-
pr_comet.commit 'Regenerate .rubocop_todo.yml' do
|
36
|
-
rubocop.auto_gen_config
|
37
|
-
end
|
38
|
-
|
39
|
-
# Create a pull request
|
40
|
-
pr_comet.create!(title: "Update v#{version}", body: '')
|