From 6541634fb0d828efb7e44d54511061519233056f Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Fri, 1 Mar 2019 22:25:27 -0300 Subject: [PATCH] style: enable Style/Semicolon rubocop --- .rubocop.yml | 3 +++ lib/rack/attack.rb | 16 ++++++++-------- lib/rack/attack/store_proxy/dalli_proxy.rb | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8e210a5..705a6a6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -68,5 +68,8 @@ Style/RedundantFreeze: Style/RedundantSelf: Enabled: true +Style/Semicolon: + Enabled: true + Style/SingleLineMethods: Enabled: true diff --git a/lib/rack/attack.rb b/lib/rack/attack.rb index 8066622..8c62e7d 100644 --- a/lib/rack/attack.rb +++ b/lib/rack/attack.rb @@ -65,20 +65,20 @@ class Rack::Attack tracks[name] = Track.new(name, options, &block) end - def safelists; - @safelists ||= {}; + def safelists + @safelists ||= {} end - def blocklists; - @blocklists ||= {}; + def blocklists + @blocklists ||= {} end - def throttles; - @throttles ||= {}; + def throttles + @throttles ||= {} end - def tracks; - @tracks ||= {}; + def tracks + @tracks ||= {} end def safelisted?(request) diff --git a/lib/rack/attack/store_proxy/dalli_proxy.rb b/lib/rack/attack/store_proxy/dalli_proxy.rb index 095bfb6..360e219 100644 --- a/lib/rack/attack/store_proxy/dalli_proxy.rb +++ b/lib/rack/attack/store_proxy/dalli_proxy.rb @@ -60,8 +60,8 @@ module Rack def stub_with_if_missing unless __getobj__.respond_to?(:with) class << self - def with; - yield __getobj__; + def with + yield __getobj__ end end end