diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-26 11:33:49 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-26 23:37:31 +0300 |
commit | 09ec075f1ee52f6bb2be83df1336e6d4924b3e9c (patch) | |
tree | 5f5e2e8d14d5b82ebe18d76ac1e53c62f9061517 | |
parent | f0c917c7d491f4f7b142748375e1128d5579152a (diff) | |
download | rails-09ec075f1ee52f6bb2be83df1336e6d4924b3e9c.tar.gz rails-09ec075f1ee52f6bb2be83df1336e6d4924b3e9c.tar.bz2 rails-09ec075f1ee52f6bb2be83df1336e6d4924b3e9c.zip |
Remove Rubocop's comments from Rails code base
PR#32381 added Rubocop's comments to some tests files in order to
exclude `Performance/RedundantMerge`.
Turn off `Performance` cops for tests files via `Exclude`
in `.rubocop.yml`.
Context https://github.com/rails/rails/pull/32381#discussion_r205212331
-rw-r--r-- | .rubocop.yml | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/header_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 9db88cbbdf..e93e7ff82f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,6 +9,10 @@ AllCops: - 'actionpack/lib/action_dispatch/journey/parser.rb' - 'railties/test/fixtures/tmp/**/*' +Performance: + Exclude: + - '**/test/**/*' + Rails: Enabled: true diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb index 43e63eb996..bd2a5b35fb 100644 --- a/actionpack/test/dispatch/header_test.rb +++ b/actionpack/test/dispatch/header_test.rb @@ -105,20 +105,16 @@ class HeaderTest < ActiveSupport::TestCase end test "#merge! headers with mutation" do - # rubocop:disable Performance/RedundantMerge @headers.merge!("Host" => "http://example.test", "Content-Type" => "text/html") - # rubocop:enable Performance/RedundantMerge assert_equal({ "HTTP_HOST" => "http://example.test", "CONTENT_TYPE" => "text/html", "HTTP_REFERER" => "/some/page" }, @headers.env) end test "#merge! env with mutation" do - # rubocop:disable Performance/RedundantMerge @headers.merge!("HTTP_HOST" => "http://first.com", "CONTENT_TYPE" => "text/html") - # rubocop:enable Performance/RedundantMerge assert_equal({ "HTTP_HOST" => "http://first.com", "CONTENT_TYPE" => "text/html", "HTTP_REFERER" => "/some/page" }, @headers.env) diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index 3ca15640fd..fbeb617b29 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -187,7 +187,7 @@ module ActiveRecord end relation = Relation.new(klass) - relation.merge!(where: ["foo = ?", "bar"]) # rubocop:disable Performance/RedundantMerge + relation.merge!(where: ["foo = ?", "bar"]) assert_equal Relation::WhereClause.new(["foo = bar"]), relation.where_clause end |