From 45568bed36095db0df94cf89a8a04458f56f33dc Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 21 Nov 2017 23:15:24 +0800 Subject: Updates based on feedback --- rubocop/cop/module_with_instance_variables.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'rubocop') diff --git a/rubocop/cop/module_with_instance_variables.rb b/rubocop/cop/module_with_instance_variables.rb index 974a23bf701..9f9856e308b 100644 --- a/rubocop/cop/module_with_instance_variables.rb +++ b/rubocop/cop/module_with_instance_variables.rb @@ -5,7 +5,7 @@ module RuboCop Do not use instance variables in a module. Please read this for the rationale behind it: - doc/development/module_with_instance_variables.md + https://docs.gitlab.com/ee/development/module_with_instance_variables.html If you think the use for this is fine, please just add: # rubocop:disable Cop/ModuleWithInstanceVariables @@ -56,9 +56,7 @@ module RuboCop add_offense(offense, :expression) end # We allow initialize method and single ivar - elsif initialize_method?(definition) || single_ivar?(definition) - next - else + elsif !initialize_method?(definition) && !single_ivar?(definition) definition.each_descendant(:ivar, :ivasgn) do |offense| add_offense(offense, :expression) end -- cgit v1.2.1