praveenvijayan / grunt-html-validation

W3C html validaton grunt plugin. Validate all files in a directory automatically.
MIT License
75 stars 39 forks source link

Fix error of undefined file. Force return when no more files to check. #48

Closed elfreyshira closed 10 years ago

elfreyshira commented 10 years ago

This PR fully fixes the error:

Fatal error: Unable to read 'undefined' file (Error code: ENOENT).

You call done(), but it doesn't fully end the validate function. The return ensures that it exits the function to end the grunt task.

I came across this error when linting 2 partial html files using the wrapfile option. My grunt config looked something like this:

validation: {
            options: {
                wrapfile: 'test/validation-wrap.html',
                reportpath: false,
                reset: true
            },
            files: {
                src: ['partials/**/*.html']
            }
        },