lib/skeptic/rules/spaces_around_operators.rb in skeptic-0.0.7 vs lib/skeptic/rules/spaces_around_operators.rb in skeptic-0.0.8

- old
+ new

@@ -4,11 +4,11 @@ DESCRIPTION = 'Check for spaces around operators' include SexpVisitor OPERATORS_WITHOUT_SPACES_AROUND_THEM = ['**', '::', '...', '..'] - IGNORED_TOKEN_TYPES = [:on_sp, :on_ignored_nl, :on_nl, :on_lparen, :on_symbeg] + IGNORED_TOKEN_TYPES = [:on_sp, :on_ignored_nl, :on_nl, :on_lparen, :on_symbeg, :on_lbracket, :on_lbrace] def initialize(data) @violations = [] @special_tokens_locations = [] end @@ -92,10 +92,10 @@ mark_special_tokens ident.last end end on :block_var do |params| - normal_params = params[1] + normal_params = params[1] || [] unless normal_params.empty? right_param = normal_params.last right_location = [right_param.last[0], right_param.last[1] ] mark_special_tokens normal_params.first.last, normal_params.last.last