From 4a05be629c67fb4a128c18176d5a9236ba5a57e0 Mon Sep 17 00:00:00 2001 From: Nate Holland Date: Sun, 5 May 2019 11:13:39 -0500 Subject: [PATCH] Selectively disabled cops for methods and classes Rubocop now requires that cops are scoped tighter. This reformats it so that only the specific method or class has the cop disabled. --- lib/http/options.rb | 4 +--- spec/support/black_hole.rb | 4 +--- spec/support/dummy_server/servlet.rb | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/http/options.rb b/lib/http/options.rb index 3337a5fc..20805abc 100644 --- a/lib/http/options.rb +++ b/lib/http/options.rb @@ -1,14 +1,12 @@ # frozen_string_literal: true -# rubocop:disable Metrics/ClassLength - require "http/headers" require "openssl" require "socket" require "http/uri" module HTTP - class Options + class Options # rubocop:disable Metrics/ClassLength @default_socket_class = TCPSocket @default_ssl_socket_class = OpenSSL::SSL::SSLSocket @default_timeout_class = HTTP::Timeout::Null diff --git a/spec/support/black_hole.rb b/spec/support/black_hole.rb index 0326fd16..c5d61dd1 100644 --- a/spec/support/black_hole.rb +++ b/spec/support/black_hole.rb @@ -2,11 +2,9 @@ module BlackHole class << self - # rubocop:disable Style/MethodMissingSuper - def method_missing(*) + def method_missing(*) # rubocop:disable Style/MethodMissingSuper self end - # rubocop:enable Style/MethodMissingSuper def respond_to_missing?(*) true diff --git a/spec/support/dummy_server/servlet.rb b/spec/support/dummy_server/servlet.rb index bc59ac25..d9702c80 100644 --- a/spec/support/dummy_server/servlet.rb +++ b/spec/support/dummy_server/servlet.rb @@ -174,4 +174,5 @@ def do_#{method.upcase}(req, res) end end end + # rubocop:enable Metrics/ClassLength end