Skip to content
This repository has been archived by the owner. It is now read-only.

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

Merged
merged 2 commits into from Aug 19, 2014

Conversation

AsaAyers
Copy link
Collaborator

@AsaAyers AsaAyers commented Aug 19, 2014

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 added a commit that referenced this issue Aug 19, 2014
Expose ErrorReport so that reporters can actually be used by 3rd party projects.
@AsaAyers AsaAyers merged commit b370d8e into master Aug 19, 2014
1 check passed
@swang swang deleted the expose-error-report branch Aug 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant