rubocop_challenger 2.0.0.pre6 → 2.0.0.pre7

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: 33d84d4d055937dc0fa3ee0aed23d03f38325ab53de12328fe9445240928d1ee
4
- data.tar.gz: 0f59e8c4731ac330142392f6a9f6f0f4ad52bc981ca0b75cbbf6326fad5ad331
3
+ metadata.gz: 22c90cea64f2773fb79c8ee599c97045b3003fc7c8c0456ba8243e6f215051c4
4
+ data.tar.gz: feea37d04644461e05d1267af6106853a2b29dd22c3308bcbbd2736cf9b41ade
5
5
  SHA512:
6
- metadata.gz: e633830be11c008791b17b4bb77c730bc330a33d99072947a3f1a4212527fe2f9629a9a470fc53ff9acfc7b1aac7c74a52ddc3673ccc4556bde4a11e40d3b47e
7
- data.tar.gz: 1a29a118c86d15f03dd181c924e6d87e08c26ca76f7e7eabe5cdaa953c3eaa47f0a9582e8972f7228f9d9b18a406463fad0a74fe112e459a2713b1d8354a0b20
6
+ metadata.gz: e656aa2baa243e7624e95052aa509e2ddfc00ddcf1ab93e4b13aa46c32f286f53ec702942c0efb5f360f0dde537a5aca682b205cdd62d7cf3ef6b09b8841c6f1
7
+ data.tar.gz: 772f0b16d39f8a40623147f42b8aaf6f78dd4d9b931e271b1691930b1d6e04cfbd1f8b920adb6eb2796b25c062d3ecb9e6c9cf05818a3c71a0e64bbd94d3be9b
@@ -2,127 +2,75 @@
2
2
  #
3
3
  # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
4
  #
5
- version: 2
5
+ version: 2.1
6
+
7
+ orbs:
8
+ ruby-orbs: sue445/ruby-orbs@1.4.3
9
+ code-climate: rvla/code-climate@0.0.2
6
10
 
7
11
  references:
8
- - &download_cc_test_reporter
9
- run:
10
- name: Download cc-test-reporter
11
- command: |
12
- mkdir -p tmp/
13
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
14
- chmod +x ./tmp/cc-test-reporter
15
- - &restore_bundle_install_cache
16
- restore_cache:
17
- keys:
18
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
19
- - v1-dependencies-
20
- - &bundle_install
21
- run:
22
- name: Bundle Install
23
- command: |
24
- bundle install --jobs=4 --retry=3 --path vendor/bundle
25
- - &save_bundle_install_cache
26
- save_cache:
27
- paths:
28
- - ./vendor/bundle
29
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
30
- - &run_rspec
31
- run:
32
- name: Run Rspec
33
- command: |
34
- mkdir /tmp/test-results
35
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
36
- ./tmp/cc-test-reporter before-build
37
- bundle exec rspec --format documentation \
38
- --color \
39
- --format RspecJunitFormatter \
40
- --out /tmp/test-results/rspec.xml \
41
- $TEST_FILES
42
- ./tmp/cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
12
+ - &ruby_version
13
+ ruby_version:
14
+ type: enum
15
+ enum: ['2.4', '2.5', '2.6', 'latest']
16
+ default: '2.4'
43
17
 
44
- - &build
18
+ executors:
19
+ default:
20
+ parameters:
21
+ <<: *ruby_version
22
+ docker:
23
+ - image: circleci/ruby:<< parameters.ruby_version >>-node-browsers
45
24
  working_directory: ~/repo
25
+
26
+ commands:
27
+ run_rspec:
28
+ description: 'Run RSpec'
46
29
  steps:
47
- - checkout
48
- - *download_cc_test_reporter
49
- - *restore_bundle_install_cache
50
- - *bundle_install
51
- - *save_bundle_install_cache
52
- - *run_rspec
30
+ - run:
31
+ name: 'Execute RSpec'
32
+ command: |
33
+ mkdir /tmp/test-results
34
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
35
+ cc-test-reporter before-build
36
+ bundle exec rspec --format documentation \
37
+ --color \
38
+ --format RspecJunitFormatter \
39
+ --out /tmp/test-results/rspec.xml \
40
+ $TEST_FILES
41
+ - code-climate/format-coverage:
42
+ input-type: simplecov
43
+ prefix: $(readlink -f .)
44
+ coverage-file: coverage/.resultset.json
45
+ output: coverage/codeclimate.$CIRCLE_BUILD_NUM.json
46
+ - persist_to_workspace:
47
+ root: coverage
48
+ paths:
49
+ - codeclimate.*.json
53
50
  - store_test_results:
54
51
  path: /tmp/test-results
55
52
  - store_artifacts:
56
53
  path: /tmp/test-results
57
54
  destination: test-results
58
- - run:
59
- name: Rake Build
60
- command: |
61
- bundle exec rake build
62
-
63
- - &rubocop
64
- working_directory: ~/repo
55
+ rubocop:
65
56
  steps:
66
- - checkout
67
- - *restore_bundle_install_cache
68
- - *bundle_install
69
- - *save_bundle_install_cache
70
- - run: bundle exec rubocop
71
-
72
- - &yardoc
73
- working_directory: ~/repo
57
+ - run:
58
+ name: Run RuboCop
59
+ command: bundle exec rubocop
60
+ yardoc:
61
+ description: 'Generate YARDoc'
74
62
  steps:
75
- - checkout
76
- - *restore_bundle_install_cache
77
- - *bundle_install
78
- - *save_bundle_install_cache
79
- - run: bundle exec yardoc -o ./yardoc
63
+ - run: bundle exec yardoc -o ./yardoc
80
64
  - store_artifacts:
81
65
  path: ./yardoc
82
66
  destination: yardoc
83
-
84
- jobs:
85
- build_on_ruby_2.4:
86
- docker:
87
- - image: circleci/ruby:2.4-node-browsers
88
- <<: *build
89
- build_on_ruby_2.5:
90
- docker:
91
- - image: circleci/ruby:2.5-node-browsers
92
- <<: *build
93
- build_on_ruby_2.6:
94
- docker:
95
- - image: circleci/ruby:2.6-node-browsers
96
- <<: *build
97
- build_on_ruby_latest:
98
- docker:
99
- - image: circleci/ruby:latest-node-browsers-legacy
100
- <<: *build
101
- rubocop:
102
- docker:
103
- - image: circleci/ruby:2.4-node-browsers
104
- <<: *rubocop
105
- yardoc:
106
- docker:
107
- - image: circleci/ruby:2.4-node-browsers
108
- <<: *yardoc
109
- verify_rubocop_challenge:
110
- docker:
111
- - image: circleci/ruby:2.4-node-browsers
112
- working_directory: ~/repo
67
+ rake_build:
113
68
  steps:
114
- - checkout
115
- - *restore_bundle_install_cache
116
- - *bundle_install
117
- - *save_bundle_install_cache
118
- - run: bundle exec rake install
119
69
  - run:
120
- name: Jailbreak
121
- command: |
122
- git config --global user.email "testing@example.com"
123
- git config --global user.name "Testing"
124
- bundle exec bin/jailbreak
125
- git commit -am "jailbreak"
70
+ name: Rake Build
71
+ command: bundle exec rake build
72
+ verify_rubocop_challenge:
73
+ steps:
126
74
  - run:
127
75
  name: Verify Rubocop Challenge
128
76
  command: |
@@ -131,13 +79,25 @@ jobs:
131
79
  --name=ryz310 \
132
80
  --mode=random \
133
81
  --no-create-pr
134
-
82
+ integration_testing:
83
+ description: Integration testing for RuboCop Challenge
84
+ steps:
85
+ - run: bundle exec rake install
86
+ - run:
87
+ name: Jailbreak
88
+ command: |
89
+ git config --global user.email "testing@example.com"
90
+ git config --global user.name "Testing"
91
+ bundle exec bin/jailbreak
92
+ git commit -am "jailbreak"
93
+ - verify_rubocop_challenge
94
+ - verify_rubocop_challenge
95
+ - verify_rubocop_challenge
96
+ - verify_rubocop_challenge
97
+ - verify_rubocop_challenge
98
+ - verify_rubocop_challenge
135
99
  rubocop_challenge:
136
- docker:
137
- - image: circleci/ruby:2.4-node-browsers
138
- working_directory: ~/repo
139
100
  steps:
140
- - checkout
141
101
  - run:
142
102
  name: Rubocop Challenge
143
103
  command: |
@@ -148,20 +108,13 @@ jobs:
148
108
  --template=./lib/templates/checklist.md.erb \
149
109
  --no-auto-gen-timestamp \
150
110
  --exclude-limit=30
151
-
152
111
  release:
153
- docker:
154
- - image: circleci/ruby:2.4-node-browsers
155
- working_directory: ~/repo
112
+ description: Release to RubyGems.org
156
113
  steps:
157
- - checkout
158
- - *restore_bundle_install_cache
159
- - *bundle_install
160
- - *save_bundle_install_cache
161
114
  - run:
162
115
  name: Create Rubygems Credentials
163
116
  command: |
164
- mkdir ~/.gem
117
+ mkdir ~/.gem || true
165
118
  echo -e "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials
166
119
  chmod 0600 ~/.gem/credentials
167
120
  - run:
@@ -169,19 +122,94 @@ jobs:
169
122
  command: |
170
123
  git push --set-upstream origin ${CIRCLE_BRANCH}
171
124
  bundle exec rake release --trace
125
+ setup:
126
+ description: Setup for Job Working
127
+ parameters:
128
+ <<: *ruby_version
129
+ steps:
130
+ - checkout
131
+ - ruby-orbs/bundle-install:
132
+ cache_key_prefix: v1-dependencies-<< parameters.ruby_version >>
133
+ test_and_build:
134
+ description: Build the RubyGem
135
+ steps:
136
+ - code-climate/install
137
+ - run_rspec
138
+ - rake_build
139
+
140
+ jobs:
141
+ build:
142
+ parameters:
143
+ <<: *ruby_version
144
+ executor:
145
+ name: default
146
+ ruby_version: << parameters.ruby_version >>
147
+ steps:
148
+ - setup:
149
+ ruby_version: << parameters.ruby_version >>
150
+ - test_and_build
151
+ upload-coverage:
152
+ executor: default
153
+ steps:
154
+ - attach_workspace:
155
+ at: ~/repo
156
+ - code-climate/install
157
+ - code-climate/sum-coverage:
158
+ input: codeclimate.*.json
159
+ parts: 4
160
+ - code-climate/upload-coverage
161
+ rubocop:
162
+ executor: default
163
+ steps:
164
+ - setup
165
+ - rubocop
166
+ yardoc:
167
+ executor: default
168
+ steps:
169
+ - setup
170
+ - yardoc
171
+ integration_testing:
172
+ executor: default
173
+ steps:
174
+ - setup
175
+ - integration_testing
176
+ rubocop_challenge:
177
+ executor: default
178
+ steps:
179
+ - checkout
180
+ - rubocop_challenge
181
+ release:
182
+ executor: default
183
+ steps:
184
+ - setup
185
+ - release
172
186
 
173
187
  workflows:
174
188
  version: 2
175
189
 
176
190
  commit:
177
191
  jobs:
178
- - build_on_ruby_2.4
179
- - build_on_ruby_2.5
180
- - build_on_ruby_2.6
181
- - build_on_ruby_latest
192
+ - build:
193
+ name: build_on_ruby_2.4
194
+ ruby_version: '2.4'
195
+ - build:
196
+ name: build_on_ruby_2.5
197
+ ruby_version: '2.5'
198
+ - build:
199
+ name: build_on_ruby_2.6
200
+ ruby_version: '2.6'
201
+ - build:
202
+ name: build_on_ruby_latest
203
+ ruby_version: 'latest'
182
204
  - rubocop
183
205
  - yardoc
184
- - verify_rubocop_challenge
206
+ - integration_testing
207
+ - upload-coverage:
208
+ requires:
209
+ - build_on_ruby_2.4
210
+ - build_on_ruby_2.5
211
+ - build_on_ruby_2.6
212
+ - build_on_ruby_latest
185
213
  - release:
186
214
  context: RubyGems API Key
187
215
  requires:
@@ -205,3 +233,10 @@ workflows:
205
233
  - master
206
234
  jobs:
207
235
  - rubocop_challenge
236
+
237
+ experimental:
238
+ notify:
239
+ branches:
240
+ only:
241
+ - master
242
+ - production
@@ -1,4 +1,6 @@
1
- require: rubocop-rspec
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
2
4
 
3
5
  inherit_from: .rubocop_todo.yml
4
6
 
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-06-22 17:06:28 +0900 using RuboCop version 0.71.0.
3
+ # on 2019-07-09 02:06:20 +0900 using RuboCop version 0.72.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
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_challenger (2.0.0.pre6)
4
+ rubocop_challenger (2.0.0.pre7)
5
5
  pr_comet (~> 0.2.0)
6
6
  rainbow
7
7
  rubocop
8
+ rubocop-performance
8
9
  rubocop-rspec
9
10
  thor
10
11
  yard
@@ -39,14 +40,14 @@ GEM
39
40
  pry-byebug (3.7.0)
40
41
  byebug (~> 11.0)
41
42
  pry (~> 0.10)
42
- public_suffix (3.1.0)
43
+ public_suffix (3.1.1)
43
44
  rainbow (3.0.0)
44
45
  rake (10.5.0)
45
46
  rspec (3.8.0)
46
47
  rspec-core (~> 3.8.0)
47
48
  rspec-expectations (~> 3.8.0)
48
49
  rspec-mocks (~> 3.8.0)
49
- rspec-core (3.8.1)
50
+ rspec-core (3.8.2)
50
51
  rspec-support (~> 3.8.0)
51
52
  rspec-expectations (3.8.4)
52
53
  diff-lcs (>= 1.2.0, < 2.0)
@@ -57,27 +58,29 @@ GEM
57
58
  rspec-support (3.8.2)
58
59
  rspec_junit_formatter (0.4.1)
59
60
  rspec-core (>= 2, < 4, != 2.12.0)
60
- rubocop (0.71.0)
61
+ rubocop (0.72.0)
61
62
  jaro_winkler (~> 1.5.1)
62
63
  parallel (~> 1.10)
63
64
  parser (>= 2.6)
64
65
  rainbow (>= 2.2.2, < 4.0)
65
66
  ruby-progressbar (~> 1.7)
66
67
  unicode-display_width (>= 1.4.0, < 1.7)
68
+ rubocop-performance (1.4.0)
69
+ rubocop (>= 0.71.0)
67
70
  rubocop-rspec (1.33.0)
68
71
  rubocop (>= 0.60.0)
69
72
  ruby-progressbar (1.10.1)
70
73
  sawyer (0.8.2)
71
74
  addressable (>= 2.3.5)
72
75
  faraday (> 0.8, < 2.0)
73
- simplecov (0.16.1)
76
+ simplecov (0.17.0)
74
77
  docile (~> 1.1)
75
78
  json (>= 1.8, < 3)
76
79
  simplecov-html (~> 0.10.0)
77
80
  simplecov-html (0.10.2)
78
81
  thor (0.20.3)
79
82
  unicode-display_width (1.6.0)
80
- yard (0.9.19)
83
+ yard (0.9.20)
81
84
 
82
85
  PLATFORMS
83
86
  ruby
@@ -6,19 +6,21 @@
6
6
  require 'bundler/setup'
7
7
  require 'rubocop_challenger'
8
8
 
9
- VERSION_FILE_PATH = 'lib/rubocop_challenger/version.rb'
9
+ CLI_FILE_PATH = 'lib/rubocop_challenger/cli.rb'
10
10
  rubocop = RubocopChallenger::Rubocop::Command.new
11
11
 
12
12
  # Read any ruby file
13
- version_file = File.read(VERSION_FILE_PATH)
13
+ cli_file = File.read(CLI_FILE_PATH)
14
14
 
15
15
  # Modify the file contents
16
- version_file.sub!('# frozen_string_literal: true', '')
17
- version_file.gsub!("\n", " \n ")
18
- version_file.concat("\nputs 'hoge'; puts 'fuga'")
16
+ cli_file.sub!('# frozen_string_literal: true', '')
17
+ cli_file.sub!("\n", " \n ")
18
+ cli_file.concat("\nputs 'hoge'; puts 'fuga'")
19
+ cli_file.concat("\narray = []")
20
+ cli_file.concat("\narray.sort { |a, b| a.foo <=> b.foo }")
19
21
 
20
22
  # Write the origin ruby file
21
- File.write(VERSION_FILE_PATH, version_file)
23
+ File.write(CLI_FILE_PATH, cli_file)
22
24
 
23
25
  # Regenerate .rubocop_todo.yml
24
26
  rubocop.auto_gen_config
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency 'pr_comet', '~> 0.2.0'
26
26
  spec.add_runtime_dependency 'rainbow'
27
27
  spec.add_runtime_dependency 'rubocop'
28
+ spec.add_runtime_dependency 'rubocop-performance'
28
29
  spec.add_runtime_dependency 'rubocop-rspec'
29
30
  spec.add_runtime_dependency 'thor'
30
31
  spec.add_runtime_dependency 'yard'
@@ -5,7 +5,6 @@ require 'yard'
5
5
  require 'rainbow'
6
6
  require 'pr_comet'
7
7
  require 'rubocop'
8
- require 'rubocop-rspec'
9
8
  require 'rubocop_challenger/errors'
10
9
  require 'rubocop_challenger/version'
11
10
  require 'rubocop_challenger/rubocop/rule'
@@ -20,3 +19,12 @@ require 'rubocop_challenger/go'
20
19
  require 'rubocop_challenger/cli'
21
20
  require 'rubocop_challenger/bundler/command'
22
21
  require 'rubocop_challenger/github/pr_template'
22
+
23
+ # Loads gems for feature of integrations
24
+ %w[rubocop-performance rubocop-rails rubocop-rspec].each do |dependency|
25
+ begin
26
+ require dependency
27
+ rescue LoadError
28
+ nil
29
+ end
30
+ end
@@ -17,7 +17,7 @@ module RubocopChallenger
17
17
  #
18
18
  # @return [Boolean] Returns true if installed
19
19
  def installed?(gem_name)
20
- !run('list', '|', 'grep', gem_name).empty?
20
+ !run('list', '|', 'grep', "' #{gem_name} '").empty?
21
21
  end
22
22
 
23
23
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopChallenger
4
- VERSION = '2.0.0.pre6'
4
+ VERSION = '2.0.0.pre7'
5
5
  end
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.pre6
4
+ version: 2.0.0.pre7
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-06-22 00:00:00.000000000 Z
11
+ date: 2019-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pr_comet
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-performance
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rubocop-rspec
57
71
  requirement: !ruby/object:Gem::Requirement