File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,34 @@ else
329
329
end
330
330
end
331
331
332
+ # Handle `html5validator` output
333
+ #
334
+ # Example:
335
+ # WARNING:html5validator.validator:"file:/home/coder/mystamps/src/main/webapp/WEB-INF/views/series/info.html":110.11-114.58: error: very long err msg.
336
+ # "file:/home/coder/mystamps/src/main/webapp/WEB-INF/views/series/info.html":438.16-438.35: error: very long err msg.
337
+ #
338
+ validator_output = 'validator.log'
339
+ unless File . file? ( validator_output )
340
+ warn ( "Couldn't find #{ validator_output } . html5validator result is unknown" )
341
+ else
342
+ errors_count = 0
343
+ File . readlines ( validator_output ) . each do |line |
344
+ errors_count += 1
345
+ line . sub! ( /^WARNING:html5validator.validator:/ , '' )
346
+
347
+ parsed = line . match ( /^"file:(?<file>[^"]+)":(?<line>\d +)[^:]+: error: (?<msg>.+)/ )
348
+ msg = parsed [ 'msg' ] . sub ( /\. $/ , '' )
349
+ file = parsed [ 'file' ] . sub ( pwd , '' )
350
+ lineno = parsed [ 'line' ]
351
+ file = github . html_link ( "#{ file } #L#{ lineno } " )
352
+
353
+ fail ( "html5validator error in #{ file } :\n #{ msg } " )
354
+ end
355
+
356
+ # TODO: add link to wiki page (#541)
357
+ print_errors_summary 'html5validator' , errors_count
358
+ end
359
+
332
360
# Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:compile` output
333
361
# Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:testCompile` output
334
362
# Handle `mvn org.codehaus.gmaven:gmaven-plugin:testCompile` output
You can’t perform that action at this time.
0 commit comments