-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add success page if there are no errors #3
Comments
Well, a reporter alone will not help here, because if there is not even a notice to report, the reporter is not called at all by the For the time being, I solved this problem by using the built-in JSON reporter and running an additional task after Let's see how to modify a typical configuration like this: htmllint: {
options: {
errorlevels: ['error', 'warning', 'info'],
reporter: './node_modules/grunt-html-html-reporter',
reporterOutput: 'results/report.html',
},
all: {
src: ['input/*.html']
}
} to achieve the same using the report converter and dealing with a missing JSON report in the "total success" case: htmllint: {
options: {
errorlevels: ['error', 'warning', 'info'],
reporter: 'json',
reporterOutput: 'results/report.json',
},
all: {
src: ['input/*.html']
}
},
'htmllint-html-report-converter': {
options: {
// Generate HTML file although the JSON source is missing after
// a successfully ended `htmllint` task, assuming, that the task
// ended successfully without any warnings or notices
includeUnreported: true
},
all: {
// How to find source HTML files to mention in the success report
input: 'snapshots/*.html',
src: 'results/report.json',
dest: 'results/report.html'
}
} If there were any old JSON reports in the report directory, they have to be removed before another clean: {
reports: ['results/*']
} Finally, there is the last problem - if the grunt.registerTask('validate', ['clean:reports', 'continue:on',
'htmllint', 'htmllint-html-report-converter', 'continue:off',
'continue:fail-on-warning']); All these tasks can be loaded like this: grunt.loadNpmTasks('grunt-continue-ext');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-html-dev');
grunt.loadNpmTasks('grunt-html-html-report-converter'); And added to npm install grunt-continue-ext grunt-contrib-clean grunt-html-dev \
grunt-html-html-report-converter --save-dev |
I opened issue 117 for htmllint about this. |
For console outputs, it's fine if an error reporter just outputs nothing if there are no errors and you have done a good job.
But if you put this graphical report html file to a server where you want to determine the validity of your project from time to time, I get only the last error report (with old errors) after fixing all of them.
It would be nice if there was a green colored output like "0 Errors in x files" or something like that.
Is this possible right now?
The text was updated successfully, but these errors were encountered: