KEMBAR78
Expose ErrorReport so that reporters can actually be used by 3rd party projects. by AsaAyers · Pull Request #330 · clutchski/coffeelint · GitHub
Skip to content
This repository was archived by the owner on Oct 19, 2021. It is now read-only.

Conversation

AsaAyers
Copy link
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 added a commit that referenced this pull request 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
@swang swang deleted the expose-error-report branch August 24, 2015 07:27
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.

1 participant