New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Aug 19, 2014

Conversation

Projects
None yet
1 participant
@AsaAyers
Collaborator

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 pull request Aug 19, 2014

Merge pull request #330 from clutchski/expose-error-report
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

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