File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,33 @@ else
279
279
end
280
280
end
281
281
282
+ # Handle `html5validator` output
283
+ #
284
+ # Example:
285
+ # 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.
286
+ # "file:/home/coder/mystamps/src/main/webapp/WEB-INF/views/series/info.html":438.16-438.35: error: very long err msg.
287
+ #
288
+ validator_output = 'validator.log'
289
+ unless File . file? ( validator_output )
290
+ warn ( "Couldn't find #{ validator_output } . html5validator result is unknown" )
291
+ else
292
+ errors_count = 0
293
+ File . readlines ( validator_output ) . each do |line |
294
+ line . sub! ( /^WARNING:html5validator.validator:/ , '' )
295
+
296
+ parsed = line . match ( /^"file:(?<file>[^"]+)":(?<line>\d +)[^:]+: error: (?<msg>.+)/ )
297
+ msg = parsed [ 'msg' ] . sub ( /\. $/ , '' )
298
+ file = parsed [ 'file' ] . sub ( pwd , '' )
299
+ lineno = parsed [ 'line' ]
300
+ file = github . html_link ( "#{ file } #L#{ lineno } " )
301
+
302
+ fail ( "html5validator error in #{ file } :\n #{ msg } " )
303
+ end
304
+
305
+ # TODO: add link to wiki page (#541)
306
+ print_errors_summary 'html5validator' , errors_count
307
+ end
308
+
282
309
# Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:compile` output
283
310
# Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:testCompile` output
284
311
# Handle `mvn org.codehaus.gmaven:gmaven-plugin:testCompile` output
You can’t perform that action at this time.
0 commit comments