praveenvijayan / grunt-html-validation

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

Allow for automatic re-validation by detecting file changes for previously validated files #47

Open dynamicdan opened 10 years ago

dynamicdan commented 10 years ago

Obviously one could run a watch task to trigger a forced (--reset=true) re-validation of a file but this is not the best approach and makes things less flexible.

I propose that the existing "validation cache" file store a hash of the file to be used for comparison to detect if a files content has changed. If so, re-validate it.

For those with performance worries, it could be an option:

"revalidationCacheCheck: true"

BTW, consider renaming the option "reset" to "alwaysRevalidate" to avoid some first run problems a lot of people seem to be having.

michaelthorne commented 9 years ago

I just ran in to this issue myself with one of my projects.

As a temporary workaround, I deleted the two JSON files that grunt-html-validation generates and then running grunt validation worked for me.

Those files being: