From 00b3b68602159c7a6826cad721a4f7b2988832fc Mon Sep 17 00:00:00 2001 From: Abhay Nikam Date: Thu, 6 Jun 2019 11:08:19 +0530 Subject: Bump rubocop to 0.71 --- .codeclimate.yml | 2 +- .rubocop.yml | 13 ++++++------ Gemfile | 1 + Gemfile.lock | 24 ++++++++++------------ actionpack/test/controller/resources_test.rb | 2 -- actionpack/test/dispatch/request_test.rb | 1 - .../test/actionpack/abstract/layouts_test.rb | 2 +- activerecord/test/cases/associations/eager_test.rb | 2 -- 8 files changed, 20 insertions(+), 27 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 7114a98266..952b330d8c 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -25,6 +25,6 @@ checks: plugins: rubocop: enabled: true - channel: rubocop-0-67 + channel: rubocop-0-71 exclude_patterns: [] diff --git a/.rubocop.yml b/.rubocop.yml index 0cfe5d5d84..22161b1e16 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,6 @@ -require: rubocop-performance +require: + - rubocop-performance + - rubocop-rails AllCops: TargetRubyVersion: 2.5 @@ -18,9 +20,6 @@ Performance: Exclude: - '**/test/**/*' -Rails: - Enabled: true - # Prefer assert_not over assert ! Rails/AssertNot: Include: @@ -77,13 +76,13 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true -Layout/FirstParameterIndentation: - Enabled: true - # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. Style/HashSyntax: Enabled: true +Layout/IndentFirstArgument: + Enabled: true + # Method definitions after `private` or `protected` isolated calls need one # extra level of indentation. Layout/IndentationConsistency: diff --git a/Gemfile b/Gemfile index 69f277be29..f0bb6fdc9b 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ gem "json", ">= 2.0.0" gem "rubocop", ">= 0.47", require: false gem "rubocop-performance", require: false +gem "rubocop-rails", require: false group :doc do gem "sdoc", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock index 6633c7a741..c8d073194b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -279,7 +279,6 @@ GEM image_processing (1.7.1) mini_magick (~> 4.0) ruby-vips (>= 2.0.13, < 3) - jar-dependencies (0.4.0) jaro_winkler (1.5.2) jaro_winkler (1.5.2-java) jdbc-mysql (5.1.46) @@ -349,18 +348,14 @@ GEM nokogiri (1.9.1-x86-mingw32) mini_portile2 (~> 2.4.0) os (1.0.0) - parallel (1.13.0) - parser (2.6.2.0) + parallel (1.17.0) + parser (2.6.3.0) ast (~> 2.4.0) path_expander (1.0.3) pg (1.1.3) pg (1.1.3-x64-mingw32) pg (1.1.3-x86-mingw32) psych (3.1.0) - psych (3.1.0-java) - jar-dependencies (>= 0.1.7) - psych (3.1.0-x64-mingw32) - psych (3.1.0-x86-mingw32) public_suffix (3.0.3) puma (3.12.1) puma (3.12.1-java) @@ -411,17 +406,19 @@ GEM resque (>= 1.26) rufus-scheduler (~> 3.2) retriable (3.1.2) - rubocop (0.67.2) + rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - psych (>= 3.1.0) + parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) + unicode-display_width (>= 1.4.0, < 1.7) rubocop-performance (1.1.0) rubocop (>= 0.67.0) - ruby-progressbar (1.10.0) + rubocop-rails (2.0.0) + rack (>= 2.0) + rubocop (>= 0.70.0) + ruby-progressbar (1.10.1) ruby-vips (2.0.13) ffi (~> 1.9) ruby_dep (1.5.0) @@ -499,7 +496,7 @@ GEM uber (0.1.0) uglifier (4.1.19) execjs (>= 0.3.0, < 3) - unicode-display_width (1.5.0) + unicode-display_width (1.6.0) useragent (0.16.10) vegas (0.1.11) rack (>= 1.0.0) @@ -584,6 +581,7 @@ DEPENDENCIES resque-scheduler rubocop (>= 0.47) rubocop-performance + rubocop-rails sass-rails sdoc (~> 1.0) selenium-webdriver (>= 3.5.0, < 3.13.0) diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index d2146f12a5..1e42a3a90d 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -36,7 +36,6 @@ class ResourcesTest < ActionController::TestCase collection: collection_methods, member: member_methods, path_names: path_names do - assert_restful_routes_for :messages, collection: collection_methods, member: member_methods, @@ -58,7 +57,6 @@ class ResourcesTest < ActionController::TestCase collection: collection_methods, member: member_methods, path_names: path_names do |options| - collection_methods.each_key do |action| assert_named_route "/messages/#{path_names[action] || action}", "#{action}_messages_path", action: action end diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index eb49396145..0ec8dd25e0 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -681,7 +681,6 @@ end class RequestMethod < BaseRequestTest test "method returns environment's request method when it has not been overridden by middleware".squish do - ActionDispatch::Request::HTTP_METHODS.each do |method| request = stub_request("REQUEST_METHOD" => method) diff --git a/actionview/test/actionpack/abstract/layouts_test.rb b/actionview/test/actionpack/abstract/layouts_test.rb index 1146e6f64b..72d8e54bf8 100644 --- a/actionview/test/actionpack/abstract/layouts_test.rb +++ b/actionview/test/actionpack/abstract/layouts_test.rb @@ -295,7 +295,7 @@ module AbstractControllerTests 10.times do |x| controller = WithString.new controller.define_singleton_method :index do - render template: ActionView::Template::Text.new("Hello string!"), locals: { :"x#{x}" => :omg } + render template: ActionView::Template::Text.new("Hello string!"), locals: { "x#{x}": :omg } end controller.process(:index) end diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index f7aad9d775..42af1ac8d8 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -789,7 +789,6 @@ class EagerAssociationTest < ActiveRecord::TestCase .where("comments.body like 'Normal%' OR comments.#{QUOTED_TYPE}= 'SpecialComment'") .references(:comments) .scoping do - posts = authors(:david).posts.limit(2).to_a assert_equal 2, posts.size end @@ -798,7 +797,6 @@ class EagerAssociationTest < ActiveRecord::TestCase .where("authors.name = 'David' AND (comments.body like 'Normal%' OR comments.#{QUOTED_TYPE}= 'SpecialComment')") .references(:authors, :comments) .scoping do - count = Post.limit(2).count assert_equal count, posts.size end -- cgit v1.2.3