Expose ErrorReport so that reporters can actually be used by 3rd party projects. #330

Merged
merged 2 commits into from Aug 19, 2014

Projects

None yet

1 participant

@AsaAyers
Collaborator

In 1.4.0 I added the --reporters option so CoffeeLint could use 3rd party reporters. I thought at the time that other tools like grunt-coffeelint would be able to use the same reporters structure. Yesterday I discovered that this simply isn't the case.

Here is a small example you can put in a temporary folder and run.

npm install 'git://github.com/clutchski/coffeelint.git#expose-error-report'
# once this gets release "npm install coffeelint" will be fine.
fs = require 'fs'

CoffeeLint = require 'coffeelint'
DefaultReporter = require 'coffeelint/lib/reporters/default'

errorReport = CoffeeLint.getErrorReport()

files = [ __filename ]
for file in files
    errorReport.lint file, fs.readFileSync(file).toString()

reporter = new DefaultReporter errorReport, {
    colorize: true
}

reporter.publish()
process.on 'exit', ->
    process.exit errorReport.getExitCode()
@AsaAyers AsaAyers merged commit b370d8e into master Aug 19, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@swang swang deleted the expose-error-report branch Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment