lib/pelusa/lint/indentation_level.rb in pelusa-0.0.1 vs lib/pelusa/lint/indentation_level.rb in pelusa-0.0.2

- old
+ new

@@ -53,42 +53,5 @@ end end end end end - def check_indentation_levels! - violations = Set.new - - get_body_from_node = lambda do |node| - if node.respond_to?(:body) && !node.body.is_a?(Rubinius::AST::NilLiteral) - node.body - elsif node.respond_to?(:else) - node.else - end - end - - iterate = self.class.iterator do |node| - if node.is_a?(Rubinius::AST::Define) - _iterate = self.class.iterator do |node| - __iterate = self.class.iterator do |node| - if body = get_body_from_node[node] - if node.line != [body].flatten.first.line - violations << body.line - end - end - end - - Array(get_body_from_node[node]).each(&__iterate) - end - node.body.array.each(&_iterate) - end - end - - report "Doesn't use more than one indentation level" do - Array(ast).each(&iterate) - if violations.empty? - Report.new - else - Report.new(violations) { |violations| "There's too much of indentation at lines #{violations.to_a.join(', ')}." } - end - end - end