Class: Jshintrb::Reporter::Default
- Inherits:
-
Object
- Object
- Jshintrb::Reporter::Default
- Defined in:
- lib/jshintrb/reporter/default.rb
Instance Method Summary collapse
Instance Method Details
#format(errors, file) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jshintrb/reporter/default.rb', line 5 def format errors, file result = '' indent = '' if file then indent = ' ' end errors.each do |error| if error.nil? then result += indent + 'fatal error' else result += indent + 'line ' + error["line"].to_s + ', col ' + error["character"].to_s + ', ' + error["reason"].to_s + "\n" end end if file && result.size > 0 then result = 'file: ' + file + "\n" + result end result end |