Skip to content

Commit

Permalink
Upgrade to Rubocop 0.82.0 and get rake passing
Browse files Browse the repository at this point in the history
  • Loading branch information
searls committed May 4, 2020
1 parent bf2d3dd commit 7685728
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
standard (0.2.5)
rubocop (~> 0.80.1)
rubocop (~> 0.82.0)
rubocop-performance (~> 1.5.2)

GEM
Expand All @@ -16,30 +16,30 @@ GEM
method_source (0.9.2)
minitest (5.14.0)
parallel (1.19.1)
parser (2.7.1.1)
parser (2.7.1.2)
ast (~> 2.4.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rainbow (3.0.0)
rake (13.0.1)
rexml (3.2.4)
rubocop (0.80.1)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
ruby-progressbar (1.10.1)
simplecov (0.18.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.0)
unicode-display_width (1.6.1)
unicode-display_width (1.7.0)

PLATFORMS
ruby
Expand Down
7 changes: 2 additions & 5 deletions config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require:
- rubocop-performance

AllCops:
# Prevent RuboCop from exploding when it finds an older-than-2.3 .ruby-version
# Prevent RuboCop from exploding when it finds an older-than-2.4 .ruby-version
TargetRubyVersion: 2.5
DisabledByDefault: true
Exclude: []
Expand Down Expand Up @@ -301,7 +301,7 @@ Layout/SpaceInsideStringInterpolation:
Enabled: true
EnforcedStyle: no_space

Layout/Tab:
Layout/IndentationStyle:
Enabled: true
IndentationWidth: ~

Expand Down Expand Up @@ -366,9 +366,6 @@ Lint/EmptyInterpolation:
Lint/EmptyWhen:
Enabled: true

Lint/EndInMethod:
Enabled: true

Lint/EnsureReturn:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion config/ruby-2.2.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherit_from: ./base.yml

AllCops:
TargetRubyVersion: 2.3 # The oldest supported
TargetRubyVersion: 2.4 # The oldest supported

Layout:
HeredocIndentation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call(options_config, standard_config)
private

def max_rubocop_supported_version(desired_version)
rubocop_supported_version = Gem::Version.new("2.3")
rubocop_supported_version = Gem::Version.new("2.4")
if desired_version < rubocop_supported_version
rubocop_supported_version
else
Expand Down
2 changes: 1 addition & 1 deletion standard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "rubocop", "~> 0.80.1"
spec.add_dependency "rubocop", "~> 0.82.0"
spec.add_dependency "rubocop-performance", "~> 1.5.2"

spec.add_development_dependency "bundler"
Expand Down
2 changes: 1 addition & 1 deletion test/cop_invoker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def self.parse(annotated_source)
annotations = []

annotated_source.each_line do |source_line|
if source_line =~ ANNOTATION_PATTERN
if ANNOTATION_PATTERN.match?(source_line)
annotations << [source.size, source_line]
else
source << source_line
Expand Down
2 changes: 1 addition & 1 deletion test/standard/builds_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_19

assert_equal DEFAULT_OPTIONS, result.rubocop_options

assert_equal config_store("test/fixture/config/w", "config/ruby-1.9.yml", 2.3), result.rubocop_config_store.for("").to_h
assert_equal config_store("test/fixture/config/w", "config/ruby-1.9.yml", 2.4), result.rubocop_config_store.for("").to_h
end

def test_specified_standard_yaml_overrides_local
Expand Down

0 comments on commit 7685728

Please sign in to comment.