Skip to content

Commit 1eec00b

Browse files
pointlessonegdiggs
authored andcommitted
Bump dependencies (#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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.3.3

Dockerfile

+3-4
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

+5-3
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

+26-27
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

+2
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

+8-5
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
+22
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]
+14
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

+2-1
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

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)
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This cop looks for duplicate values in enum declarations.
2+
3+
### Example:
4+
# bad
5+
enum status: { active: 0, archived: 0 }
6+
7+
# good
8+
enum status: { active: 0, archived: 1 }
9+
10+
# bad
11+
enum status: [:active, :archived, :active]
12+
13+
# good
14+
enum status: [:active, :archived]

config/contents/style/empty_method.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This cop checks for the formatting of empty method definitions.
2+
By default it enforces empty method definitions to go on a single
3+
line (compact style), but it cah be configured to enforce the `end`
4+
to go on its own line (expanded style.)
5+
6+
Note: A method definition is not considered empty if it contains
7+
comments.
8+
9+
### Example:
10+
11+
EnforcedStyle: compact (default)
12+
13+
# bad
14+
def foo(bar)
15+
end
16+
17+
# good
18+
def foo(bar); end
19+
def foo(bar)
20+
# baz
21+
end
22+
23+
EnforcedStyle: expanded
24+
25+
# bad
26+
def foo(bar); end
27+
28+
# good
29+
def foo(bar)
30+
end
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
This cop checks for usage of comparison operators (`==`, `!=`,
2-
`>`, `<`) to test numbers as zero, nonzero, positive, or negative.
1+
This cop checks for usage of comparison operators (`==`,
2+
`>`, `<`) to test numbers as zero, positive, or negative.
33
These can be replaced by their respective predicate methods.
44
The cop can also be configured to do the reverse.
55

6+
The cop disregards `nonzero?` as it its value is truthy or falsey,
7+
but not `true` and `false`, and thus not always interchangeable with
8+
`!= 0`.
9+
610
### Example:
711

812
# EnforcedStyle: predicate (default)
913

1014
# bad
1115

1216
foo == 0
13-
0 != bar.baz
1417
0 > foo
1518
bar.baz > 0
1619

1720
# good
1821

1922
foo.zero?
20-
bar.baz.nonzero?
2123
foo.negative?
2224
bar.baz.positive?
2325

@@ -28,13 +30,11 @@ The cop can also be configured to do the reverse.
2830
# bad
2931

3032
foo.zero?
31-
bar.baz.nonzero?
3233
foo.negative?
3334
bar.baz.positive?
3435

3536
# good
3637

3738
foo == 0
38-
0 != bar.baz
3939
0 > foo
4040
bar.baz > 0

config/contents/style/ternary_parentheses.md

+14
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,18 @@ parentheses using `EnforcedStyle`.
2828
# good
2929
foo = (bar?) ? a : b
3030
foo = (bar.baz) ? a : b
31+
foo = (bar && baz) ? a : b
32+
33+
### Example:
34+
35+
EnforcedStyle: require_parentheses_when_complex
36+
37+
# bad
38+
foo = (bar?) ? a : b
39+
foo = (bar.baz?) ? a : b
40+
foo = bar && baz ? a : b
41+
42+
# good
43+
foo = bar? ? a : b
44+
foo = bar.baz ? a : b
3145
foo = (bar && baz) ? a : b

lib/cc/engine/category_parser.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module CC
24
module Engine
35
class CategoryParser
@@ -11,7 +13,7 @@ def category
1113

1214
private
1315

14-
DEFAULT_CATEGORY = "Style".freeze
16+
DEFAULT_CATEGORY = "Style"
1517
CATEGORIES = {
1618
"Lint" => "Style",
1719
"Lint/Eval" => "Security",

lib/cc/engine/content_resolver.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "active_support/core_ext/string"
24

35
module CC

lib/cc/engine/file_list_resolver.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module CC
24
module Engine
35
class FileListResolver

lib/cc/engine/fingerprint.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "digest/md5"
24

35
module CC

0 commit comments

Comments
 (0)