Skip to content

Commit 1eec00b

Browse files
pointlessonegdiggs
authored andcommitted
Bump dependencies (codeclimate#87)
* Bump Ruby to 2.3.3 * Bump Rubocop and other gems * Stop creating blank files * Fix code style
1 parent 2a23b0f commit 1eec00b

27 files changed

+205
-64
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.3.3

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM codeclimate/alpine-ruby:b38
1+
FROM ruby:2.3-alpine
22

33
WORKDIR /usr/src/app
44
COPY Gemfile /usr/src/app/
55
COPY Gemfile.lock /usr/src/app/
66

7-
RUN apk --update add ruby ruby-dev ruby-bundler build-base git && \
7+
RUN gem install bundler && \
88
bundle install -j 4 && \
9-
apk del build-base && rm -fr /usr/share/ri
9+
rm -fr /usr/share/ri
1010

1111
RUN adduser -u 9000 -D app
1212
COPY . /usr/src/app
@@ -16,6 +16,5 @@ USER app
1616

1717
VOLUME /code
1818
WORKDIR /code
19-
ENV GEM_PATH /code/vendor/bundle/ruby/2.2.0
2019

2120
CMD ["/usr/src/app/bin/codeclimate-rubocop"]

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gem "activesupport", require: false
4-
gem "rubocop", "~> 0.45.0", require: false
6+
gem "parser", "~> 2.3.3.1"
7+
gem "pry", require: false
8+
gem "rubocop", "~> 0.45", require: false
59
gem "rubocop-migrations", require: false
610
gem "rubocop-rspec", require: false
711
gem "safe_yaml"
8-
gem "pry", require: false
9-
gem "parser", "~> 2.3.1.1"
1012

1113
group :test do
1214
gem "rake"

Gemfile.lock

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,71 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (4.2.5.1)
4+
activesupport (5.0.1)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
56
i18n (~> 0.7)
6-
json (~> 1.7, >= 1.7.7)
77
minitest (~> 5.1)
8-
thread_safe (~> 0.3, >= 0.3.4)
98
tzinfo (~> 1.1)
109
ast (2.3.0)
11-
coderay (1.1.0)
10+
coderay (1.1.1)
11+
concurrent-ruby (1.0.3)
1212
diff-lcs (1.2.5)
1313
i18n (0.7.0)
14-
json (1.8.3)
1514
method_source (0.8.2)
16-
minitest (5.8.4)
17-
parser (2.3.1.4)
15+
minitest (5.10.1)
16+
parser (2.3.3.1)
1817
ast (~> 2.2)
1918
powerpack (0.1.1)
20-
pry (0.10.3)
19+
pry (0.10.4)
2120
coderay (~> 1.1.0)
2221
method_source (~> 0.8.1)
2322
slop (~> 3.4)
2423
rainbow (2.1.0)
25-
rake (10.5.0)
26-
rspec (3.3.0)
27-
rspec-core (~> 3.3.0)
28-
rspec-expectations (~> 3.3.0)
29-
rspec-mocks (~> 3.3.0)
30-
rspec-core (3.3.1)
31-
rspec-support (~> 3.3.0)
32-
rspec-expectations (3.3.0)
24+
rake (12.0.0)
25+
rspec (3.5.0)
26+
rspec-core (~> 3.5.0)
27+
rspec-expectations (~> 3.5.0)
28+
rspec-mocks (~> 3.5.0)
29+
rspec-core (3.5.4)
30+
rspec-support (~> 3.5.0)
31+
rspec-expectations (3.5.0)
3332
diff-lcs (>= 1.2.0, < 2.0)
34-
rspec-support (~> 3.3.0)
35-
rspec-mocks (3.3.1)
33+
rspec-support (~> 3.5.0)
34+
rspec-mocks (3.5.0)
3635
diff-lcs (>= 1.2.0, < 2.0)
37-
rspec-support (~> 3.3.0)
38-
rspec-support (3.3.0)
39-
rubocop (0.45.0)
36+
rspec-support (~> 3.5.0)
37+
rspec-support (3.5.0)
38+
rubocop (0.46.0)
4039
parser (>= 2.3.1.1, < 3.0)
4140
powerpack (~> 0.1)
4241
rainbow (>= 1.99.1, < 3.0)
4342
ruby-progressbar (~> 1.7)
4443
unicode-display_width (~> 1.0, >= 1.0.1)
4544
rubocop-migrations (0.1.2)
4645
rubocop (~> 0.41)
47-
rubocop-rspec (1.5.0)
48-
rubocop (>= 0.40.0)
46+
rubocop-rspec (1.8.0)
47+
rubocop (>= 0.42.0)
4948
ruby-progressbar (1.8.1)
5049
safe_yaml (1.0.4)
5150
slop (3.6.0)
5251
thread_safe (0.3.5)
5352
tzinfo (1.2.2)
5453
thread_safe (~> 0.1)
55-
unicode-display_width (1.1.1)
54+
unicode-display_width (1.1.2)
5655

5756
PLATFORMS
5857
ruby
5958

6059
DEPENDENCIES
6160
activesupport
62-
parser (~> 2.3.1.1)
61+
parser (~> 2.3.3.1)
6362
pry
6463
rake
6564
rspec
66-
rubocop (~> 0.45.0)
65+
rubocop (~> 0.45)
6766
rubocop-migrations
6867
rubocop-rspec
6968
safe_yaml
7069

7170
BUNDLED WITH
72-
1.13.3
71+
1.13.6

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "rspec/core/rake_task"
24

35
Rake.add_rakelib "lib/tasks"

bin/codeclimate-rubocop

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
$:.unshift(
35
File.expand_path(File.join(File.dirname(__FILE__), "../lib"))
46
)
57

68
require 'cc/engine/rubocop'
79

8-
if File.exist?("/config.json")
9-
engine_config = JSON.parse(File.read("/config.json"))
10-
else
11-
engine_config = {}
12-
end
10+
engine_config =
11+
if File.exist?("/config.json")
12+
JSON.parse(File.read("/config.json"))
13+
else
14+
{}
15+
end
1316

1417
CC::Engine::Rubocop.new(Dir.pwd, engine_config, STDOUT).run
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
A Gem's requirements should be listed only once in a Gemfile.
2+
### Example:
3+
# bad
4+
gem 'rubocop'
5+
gem 'rubocop'
6+
7+
# bad
8+
group :development do
9+
gem 'rubocop'
10+
end
11+
12+
group :test do
13+
gem 'rubocop'
14+
end
15+
16+
# good
17+
group :development, :test do
18+
gem 'rubocop'
19+
end
20+
21+
# good
22+
gem 'rubocop', groups: [:development, :test]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Gems in consecutive lines should be alphabetically sorted
2+
### Example:
3+
# bad
4+
gem 'rubocop'
5+
gem 'rspec'
6+
7+
# good
8+
gem 'rspec'
9+
gem 'rubocop'
10+
11+
# good
12+
gem 'rubocop'
13+
14+
gem 'rspec'

config/contents/lint/non_local_exit_from_iterator.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
This cop checks for non-local exit from iterator, without return value.
22
It warns only when satisfies all of these: `return` doesn't have return
33
value, the block is preceded by a method chain, the block has arguments,
4-
and the method which receives the block is not `define_method`.
4+
and the method which receives the block is not `define_method`
5+
or `define_singleton_method`.
56

67
### Example:
78

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This cop identifies places where `sort { |a, b| a.foo <=> b.foo }`
2+
can be replaced by `sort_by(&:foo)`.
3+
This cop also checks `max` and `min` methods.
4+
5+
### Example:
6+
# bad
7+
array.sort { |a, b| a.foo <=> b.foo }
8+
array.max { |a, b| a.foo <=> b.foo }
9+
array.min { |a, b| a.foo <=> b.foo }
10+
11+
# good
12+
array.sort_by(&:foo)
13+
array.sort_by { |v| v.foo }
14+
array.sort_by do |var|
15+
var.foo
16+
end
17+
array.max_by(&:foo)
18+
array.min_by(&:foo)

0 commit comments

Comments
 (0)