Skip to content

Danger fails on some error from html5validator #1132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
php-coder opened this issue Sep 30, 2019 · 1 comment
Closed

Danger fails on some error from html5validator #1132

php-coder opened this issue Sep 30, 2019 · 1 comment

Comments

@php-coder
Copy link
Owner

Failure error:

[!] Invalid Dangerfile file: undefined method [] for nil:NilClass

 #  from Dangerfile:396
 #  -------------------------------------------
 #  		parsed = line.match(/^"file:(?<file>[^"]+)":(?<line>\d+)[^:]+: (error|info warning): (?<msg>.+)/)
 >  		msg    = parsed['msg'].sub(/\.$/, '')
 #  		file   = parsed['file'].sub(pwd, '')
 #  -------------------------------------------

html5validator output:

=====> Run html5validator

ERROR:html5validator.validator:"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":11.2-11.43: error: Element "head" is missing a required instance of child element "title".
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":11.2-11.43: info warning: Element name "th:block" cannot be represented as XML 1.0.
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":11.2-11.43: error: Element "th:block" not allowed as child of element "body" in this context. (Suppressing further errors from this subtree.)
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":16.2-16.102: error: A "link" element must not appear as a descendant of a "body" element unless the "link" element has an "itemprop" attribute or has a "rel" attribute whose value contains "dns-prefetch", "pingback", "preconnect", "prefetch", "preload", "prerender", or "stylesheet".
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":19.1-19.7: error: Stray end tag "head".
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":20.1-20.6: error: Start tag "body" seen but an element of the same type was already open.
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":63.4-63.45: info warning: Element name "th:block" cannot be represented as XML 1.0.
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":63.4-63.45: error: Element "th:block" not allowed as child of element "div" in this context. (Suppressing further errors from this subtree.)
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":67.5-67.87: error: Duplicate ID "error-msg".
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":64.5-64.70: info warning: The first occurrence of ID "error-msg" was here.
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":70.5-70.87: error: Duplicate ID "error-msg".
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/status-code.html":64.5-64.70: info warning: The first occurrence of ID "error-msg" was here.
@php-coder php-coder added this to the 0.4.2 milestone Sep 30, 2019
@php-coder php-coder self-assigned this Sep 30, 2019
@php-coder
Copy link
Owner Author

I was able to reproduce it locally and found the cause. It fails on

ERROR:html5validator.validator:"file:/Users/coder/git/mystamps/src/main/webapp/WEB-INF/views/site/events.html":194.4-194.30: error: Duplicate ID "logo".

because the line is started from ERROR:html5validator.validator: while we expect it to start with WARNING:html5validator.validator:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant