lib/system/lint_pass2.rb
# Lint Pass 2 - compare indent levels between adjacent non-empty lines
Lint Pass 2 - compare indent levels between adjacent non-empty lines
Lint Pass 2 - compare indent levels between adjacent non - empty lines
def lint_pass2(buffer)
  blacklog = []
  comparator = CompareIndent.new
  previous = 0
  buffer.to_s.lines.each_with_index do |l, n|
    unless l.chomp.empty?
      indent = get_indent(l)
      result = comparator.cmp indent, previous
      blacklog << "Line #{n + 1}: indent: #{result[0]} previous #{result[1]}" unless result.nil?
    else
      indent = previous 
    end
    previous = indent
  end
  blacklog
end
def lint_pass2 ( buffer ) blacklog = [ ] comparator = CompareIndent . new previous = 0 buffer . to_s . lines . each_with_index do | l , n | unless l . chomp . empty? indent = get_indent ( l ) result = comparator . cmp indent , previous blacklog << "Line #{n + 1}: indent: #{result[0]} previous #{result[1]}" unless result . nil? else indent = previous end previous = indent end blacklog end
Lint Pass 2 - compare indent levels between adjacent non-empty lines
Lint Pass 2 - compare indent levels between adjacent non - empty lines
# compare previous # blank lines are OK to skip
buffer
<not_specific>