I wrote a command line shell script [1] that generates pages on localhost then posts the result to the w3c validator and prints out the number of errors. I've been wanting this for a while [2]. I thought I'd share this in case it is of interest to others and to see whether anyone can/wants to add it to Jenkins reports. Things like unclosed DIVS can cause huge problems in causing browser bugs and are easy to capture with such a tool.
The proof is in the pudding - thanks to this tool I just identified and applied a fix for this bug [3].
Running the script on MobileFrontend now I currently get the following: 2 validation errors found in main namespace page [see tmp/validate_page.json] 2 validation errors found in special page html markup [see tmp/validate_special_page.json]
If there are no errors it will not print anything.
.... so as an action item it would be great if these 2 validation errors could be fixed so that we and others could use such a script in a pre-commit hook to prevent introducing new errors to our code (both validation errors reside in core) - the offending errors are these:
* Bad value edit for attribute rel on element link: The string edit is not a registered keyword or absolute URL. (offending html is <link rel="edit" title="Edit" href="/w/index.php?title=W3CValidationTest&action=edit" /> and bug [4])
* Bad value ResourceLoaderDynamicStyles for attribute name on element meta: Keyword resourceloaderdynamicstyles is not registered. (see bug 38630 [5] )
Enjoy!
[1] https://gerrit.wikimedia.org/r/61775 [2] https://bugzilla.wikimedia.org/show_bug.cgi?id=31876 [3] https://bugzilla.wikimedia.org/35233 [4] https://bugzilla.wikimedia.org/show_bug.cgi?id=40385 [5] https://bugzilla.wikimedia.org/show_bug.cgi?id=38630
Like a boss! Thanks Jon.
On Wed, May 1, 2013 at 11:22 AM, Jon Robson jdlrobson@gmail.com wrote:
W3CValidationTest
$wgValidateAllHtml ?
-bawolff
On 2013-05-01 3:36 PM, "Rob Moen" rmoen@wikimedia.org wrote:
Like a boss! Thanks Jon.
On Wed, May 1, 2013 at 11:22 AM, Jon Robson jdlrobson@gmail.com wrote:
W3CValidationTest
-- Rob Moen Wikimedia Foundation rmoen@wikimedia.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org