rubocop_challenger 0.4.1 → 0.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: 0c62287bd8b6f8d30cf267cd97de4d0ed75bae2221921c3aaa5ae693ca84425b
4
- data.tar.gz: c36a4659c2dcfdb1a7855c4520b4888bfdfb90d439ac2eb23946a6c4acfe6fd5
3
+ metadata.gz: 4c24828f82d19869be8ae26ca02b4fefa28ad04f9c6f79ebb572e2a7ecd4f53f
4
+ data.tar.gz: da89b53d2c43b5ae8f2e0823646b1c1286c1426d865d19864ecfea7d1da84f0d
5
5
  SHA512:
6
- metadata.gz: 8954be18ac3ea3123f3d2bb9bfe69e535a3320a17e31bea8bc8470bd7fd8b640fadd127c39c1582b5d1e7e6a04decdac8b5bbf52ee7da5ea524c181b16941662
7
- data.tar.gz: ec6c16b49f0f8d16364667407a19392100f4770e116d0f6935365f04bcd1edb9c8aad0655ab271e3146752167470774637385f7dae56883a6a08212e4c26121b
6
+ metadata.gz: a33f4986067cb9dbfb94db0659954ef62c66c3ee215db3296a45991ae55b7c632295672a027534ed13224d18756d88eb287ed56a10059541367fdd676e405ce9
7
+ data.tar.gz: 5b798f4cd53a3a9c3eb9cbf1dc45169d4c9c2e8785b15a23a2609cfdf9fff12920f559fecb5c62314f7d1951a40aa71c84177c3fd96b075f284211389f3f8dc9
data/.rubocop_todo.yml CHANGED
@@ -1,22 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-10-28 11:16:18 +0900 using RuboCop version 0.60.0.
3
+ # on 2018-10-28 23:30:18 +0000 using RuboCop version 0.60.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
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 14
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
12
- # SupportedHashRocketStyles: key, separator, table
13
- # SupportedColonStyles: key, separator, table
14
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
15
- Layout/AlignHash:
16
- Exclude:
17
- - 'bin/create_release_pr'
18
- - 'lib/rubocop_challenger/cli.rb'
19
-
20
9
  # Offense count: 7
21
10
  # Configuration parameters: CountComments, ExcludedMethods.
22
11
  # ExcludedMethods: refine
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_challenger (0.4.1)
4
+ rubocop_challenger (0.5.0)
5
5
  pr-daikou (~> 0.2.0)
6
6
  rubocop
7
7
  rubocop-rspec
@@ -15,7 +15,7 @@ GEM
15
15
  diff-lcs (1.3)
16
16
  jaro_winkler (1.5.1)
17
17
  parallel (1.12.1)
18
- parser (2.5.1.2)
18
+ parser (2.5.3.0)
19
19
  ast (~> 2.4.0)
20
20
  powerpack (0.1.2)
21
21
  pr-daikou (0.2.0)
data/README.md CHANGED
@@ -7,6 +7,8 @@ On the other hand, `rubocop` has [`--auto-correct`](https://github.com/rubocop-h
7
7
  It is ideal that to remove a disabled rule from `.rubocop_todo.yml` every day, to check whether it passes test, and can be obtained consent from the team. But it requires strong persistence and time.
8
8
  I call such work *Rubocop Challenge*. And the *RubocopChallenger* is a gem to support this challenge!
9
9
 
10
+ [![Rubocop Challenge](images/rubocop_challenge.png)](https://github.com/ryz310/rubocop_challenger/pull/97)
11
+
10
12
  ## Rubocop Challenge Flow
11
13
 
12
14
  1. Run *RubocopChallenger* periodically from CI tool etc.
@@ -32,18 +32,18 @@ File.write('lib/rubocop_challenger/version.rb', <<~VERSION)
32
32
  end
33
33
  VERSION
34
34
 
35
- # Bundle Install
36
- `bundle install`
35
+ # Bundle Update
36
+ `bundle update`
37
37
 
38
38
  # Create PR
39
39
  PRDaikou.exec(
40
40
  {
41
- email: `git config user.email`,
42
- name: `git config user.name`,
43
- base: 'master',
44
- title: "Update v#{version}",
45
- labels: '',
46
- topic: "update/v#{version}",
47
- commit: "Update v#{version}"
41
+ email: `git config user.email`,
42
+ name: `git config user.name`,
43
+ base: 'master',
44
+ title: "Update v#{version}",
45
+ labels: '',
46
+ topic: "update/v#{version}",
47
+ commit: "Update v#{version}"
48
48
  }, nil
49
49
  )
Binary file
@@ -89,14 +89,14 @@ module RubocopChallenger
89
89
 
90
90
  def generate_pr_daikou_options(target_rule)
91
91
  {
92
- email: options[:email],
93
- name: options[:name],
94
- base: options[:base],
95
- title: target_rule.title,
92
+ email: options[:email],
93
+ name: options[:name],
94
+ base: options[:base],
95
+ title: target_rule.title,
96
96
  description: pr_template(target_rule),
97
- labels: options[:labels].join(','),
98
- topic: generate_topic(target_rule),
99
- commit: ":robot: #{target_rule.title}"
97
+ labels: options[:labels].join(','),
98
+ topic: generate_topic(target_rule),
99
+ commit: ":robot: #{target_rule.title}"
100
100
  }
101
101
  end
102
102
 
@@ -4,11 +4,11 @@ module RubocopChallenger
4
4
  module Rubocop
5
5
  class Command
6
6
  def auto_correct
7
- `rubocop --auto-correct || true`
7
+ `bundle exec rubocop --auto-correct || true`
8
8
  end
9
9
 
10
10
  def auto_gen_config
11
- `rubocop --auto-gen-config || true`
11
+ `bundle exec rubocop --auto-gen-config || true`
12
12
  end
13
13
  end
14
14
  end
@@ -15,7 +15,7 @@ module RubocopChallenger
15
15
  end
16
16
 
17
17
  def examples
18
- yardoc.tags('example').map(&:text)
18
+ yardoc.tags('example').map { |tag| [tag.name, tag.text] }
19
19
  end
20
20
 
21
21
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopChallenger
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -11,10 +11,14 @@
11
11
  <% end -%>
12
12
  >
13
13
  > ### Examples
14
- <% examples.each do |example| -%>
14
+ <% examples.each do |name, text| -%>
15
+ <% unless name.empty? -%>
16
+ >
17
+ > #### <%= name %>
18
+ <% end -%>
15
19
  >
16
20
  > ```rb
17
- <% example.each_line do |line| -%>
21
+ <% text.each_line do |line| -%>
18
22
  <%= "> #{line}".chomp.strip %>
19
23
  <% end -%>
20
24
  > ```
@@ -11,10 +11,14 @@
11
11
  <% end -%>
12
12
  >
13
13
  > ### Examples
14
- <% examples.each do |example| -%>
14
+ <% examples.each do |name, text| -%>
15
+ <% unless name.empty? -%>
16
+ >
17
+ > #### <%= name %>
18
+ <% end -%>
15
19
  >
16
20
  > ```rb
17
- <% example.each_line do |line| -%>
21
+ <% text.each_line do |line| -%>
18
22
  <%= "> #{line}".chomp.strip %>
19
23
  <% end -%>
20
24
  > ```
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: 0.4.1
4
+ version: 0.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: 2018-10-28 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pr-daikou
@@ -164,6 +164,7 @@ files:
164
164
  - exe/rubocop_challenger
165
165
  - images/circleci_environment_variables.png
166
166
  - images/generate_token.png
167
+ - images/rubocop_challenge.png
167
168
  - lib/rubocop_challenger.rb
168
169
  - lib/rubocop_challenger/cli.rb
169
170
  - lib/rubocop_challenger/github/pr_template.rb