coffeelint
Version:
Lint your CoffeeScript
44 lines (32 loc) • 1.16 kB
text/coffeescript
# A summary of errors in a CoffeeLint run.
module.exports = class ErrorReport
constructor : () ->
= {}
lint: (filename, source, config = {}, literate = false) ->
[filename] = .lint(source, config, literate)
getExitCode : () ->
for path of
return 1 if
return 0
getSummary : () ->
pathCount = errorCount = warningCount = 0
for path, errors of
pathCount++
for error in errors
errorCount++ if error.level is 'error'
warningCount++ if error.level is 'warn'
return {errorCount, warningCount, pathCount}
getErrors : (path) ->
return [path]
pathHasWarning : (path) ->
return
pathHasError : (path) ->
return
hasError : () ->
for path of
return true if
return false
_hasLevel : (path, level) ->
for error in [path]
return true if error.level is level
return false