aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-16 18:14:49 +0900
committerGitHub <noreply@github.com>2019-04-16 18:14:49 +0900
commit96851dcee6a11f3ca48abaa34b1d38bb4766406e (patch)
tree193aafddff9baafc46c2874579ed72216ca5bfff
parent78255ccae84bf72cbc7a62bd26123c2eae27851c (diff)
parentc6379fd27f159177a54f34796a0f5e4c778c4290 (diff)
downloadrails-96851dcee6a11f3ca48abaa34b1d38bb4766406e.tar.gz
rails-96851dcee6a11f3ca48abaa34b1d38bb4766406e.tar.bz2
rails-96851dcee6a11f3ca48abaa34b1d38bb4766406e.zip
Merge pull request #35989 from koic/bump_rubocop_to_0_67_2
Bump RuboCop to 0.67.2
-rw-r--r--.codeclimate.yml2
-rw-r--r--.rubocop.yml2
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock5
-rw-r--r--actionview/test/template/resolver_shared_tests.rb6
-rw-r--r--activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb4
6 files changed, 14 insertions, 6 deletions
diff --git a/.codeclimate.yml b/.codeclimate.yml
index 50e0f7a657..7114a98266 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -25,6 +25,6 @@ checks:
plugins:
rubocop:
enabled: true
- channel: rubocop-0-66
+ channel: rubocop-0-67
exclude_patterns: []
diff --git a/.rubocop.yml b/.rubocop.yml
index 3dbd4a27a6..0cfe5d5d84 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,3 +1,5 @@
+require: rubocop-performance
+
AllCops:
TargetRubyVersion: 2.5
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
diff --git a/Gemfile b/Gemfile
index b5c6312c52..f3dea80e45 100644
--- a/Gemfile
+++ b/Gemfile
@@ -29,6 +29,7 @@ gem "uglifier", ">= 1.3.0", require: false
gem "json", ">= 2.0.0"
gem "rubocop", ">= 0.47", require: false
+gem "rubocop-performance", require: false
group :doc do
gem "sdoc", "~> 1.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index b92603d799..62ad1134d5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -411,7 +411,7 @@ GEM
resque (~> 1.26)
rufus-scheduler (~> 3.2)
retriable (3.1.2)
- rubocop (0.66.0)
+ rubocop (0.67.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
@@ -419,6 +419,8 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
+ rubocop-performance (1.1.0)
+ rubocop (>= 0.67.0)
ruby-progressbar (1.10.0)
ruby-vips (2.0.13)
ffi (~> 1.9)
@@ -581,6 +583,7 @@ DEPENDENCIES
resque
resque-scheduler
rubocop (>= 0.47)
+ rubocop-performance
sass-rails
sdoc (~> 1.0)
selenium-webdriver (>= 3.5.0, < 3.13.0)
diff --git a/actionview/test/template/resolver_shared_tests.rb b/actionview/test/template/resolver_shared_tests.rb
index 525b452075..8b47c5bc89 100644
--- a/actionview/test/template/resolver_shared_tests.rb
+++ b/actionview/test/template/resolver_shared_tests.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ResolverSharedTests
attr_reader :tmpdir
@@ -7,7 +9,7 @@ module ResolverSharedTests
end
end
- def with_file(filename, source="File at #{filename}")
+ def with_file(filename, source = "File at #{filename}")
path = File.join(tmpdir, filename)
FileUtils.mkdir_p(File.dirname(path))
File.write(path, source)
@@ -103,7 +105,7 @@ module ResolverSharedTests
c = context.find("hello_world", "test", false, [], {})
# disable_cache should give us a new object
- refute_same a, b
+ assert_not_same a, b
# but it should not clear the cache
assert_same a, c
diff --git a/activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb b/activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb
index a2d289bf2f..d3184f39f5 100644
--- a/activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb
+++ b/activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb
@@ -209,7 +209,7 @@ module ActiveRecord
config = {
"default_env" => {
"animals" => { adapter: "sqlite3", database: "db/animals.sqlite3" },
- "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" }
+ "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" }
}
}
@prev_configs, ActiveRecord::Base.configurations = ActiveRecord::Base.configurations, config
@@ -236,7 +236,7 @@ module ActiveRecord
config = {
"default_env" => {
"animals" => { adapter: "sqlite3", database: "db/animals.sqlite3" },
- "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" }
+ "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" }
}
}
@prev_configs, ActiveRecord::Base.configurations = ActiveRecord::Base.configurations, config