Skip to content
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

Add back vnu-jar for HTML validation #24149

Merged
merged 4 commits into from
Oct 8, 2017
Merged

Add back vnu-jar for HTML validation #24149

merged 4 commits into from
Oct 8, 2017

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Sep 27, 2017

After discussing this with @bardiharborow, I think this is the best middle solution; if Java is available HTML validation will run, otherwise it will be skipped.

Also, this is a lot faster than the html-validator solution and we don't introduce another point of external failure (like with Sauce Labs).

TODO:

  • Fix ignores
  • Fix multiple ignores
  • Combine ignores to an array instead of manually doing this?
  • Update jekyll-toc when they fix the HTML validation issues upstream
  • Verify ignores

Fixes #23171

@XhmikosR
Copy link
Member Author

I believe this is ready. Perhaps we'd like to wait until the jekyll-toc errors are fixed upstream before merging this... or not.

@patrickhlauke: which of the other errors should be ignored?

Note that I'm ignoring warnings on purpose. We might want to revisit this later.

@bardiharborow
Copy link
Member

@XhmikosR I think you should add Element "ul" not allowed as child of element "ul" in this context. as an ignore for now. Without further investigation I'm unsure about the other errors.

@XhmikosR XhmikosR self-assigned this Oct 1, 2017
@XhmikosR
Copy link
Member Author

XhmikosR commented Oct 1, 2017

I think I'll wait a couple of days since the jekyll-toc issue seems to be WIP.

We still need @patrickhlauke's feedback about the remaining errors and which we should ignore.

@XhmikosR XhmikosR force-pushed the html-linting branch 4 times, most recently from cc696b7 to e619312 Compare October 2, 2017 19:07
@XhmikosR XhmikosR force-pushed the html-linting branch 2 times, most recently from cd93f30 to 26db653 Compare October 3, 2017 07:03
@XhmikosR
Copy link
Member Author

XhmikosR commented Oct 3, 2017

Does anybody have any idea why ignoring specific errors doesn't work?

EDIT:

All right, after discussing this with @sideshowbarker on IRC, it appears the messages are inconsistent thus leading to this issue. grunt-html filters the errors differently and doesn't pass filterpattern thus the issue isn't present there.

I'll wait a bit for this to be addressed and we should be ready to merge in a few days, hopefully.

@XhmikosR XhmikosR force-pushed the html-linting branch 11 times, most recently from fd3c19b to 66cce53 Compare October 7, 2017 07:23
@XhmikosR
Copy link
Member Author

XhmikosR commented Oct 7, 2017

@bardiharborow @Johann-S @mdo: I changed this PR to not remove htmlhint and just add vnu-jar which will run if Java is available.

What do you think?

There's also the need to verify what we ignored in this branch. @patrickhlauke: can you have a quick look?

Copy link
Member

@Johann-S Johann-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 just a question, so we will use your script only if folks have Java ? Not on Travis ?


childProcess.exec('java -version', function (error) {
if (error) {
console.error('Skipping HTML lint test; Java is missing.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you return directly after that console.error you should throw an error instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to fail here; if Java isn't installed we are just skipping vnu-jar.

@bardiharborow
Copy link
Member

@XhmikosR seems fine to me.

  • Attribute “autocomplete” is only allowed when the input type is “color”, “date”, “datetime-local”, “email”, “hidden”, “month”, “number”, “password”, “range”, “search”, “tel”, “text”, “time”, “url”, or “week”. is likely intentionally non-standard.
  • Attribute “autocomplete” not allowed on element “button” at this point. is likely intentionally non-standard.
  • Attribute “title” not allowed on element “circle” at this point. I'm not sure about, likely an SVG issue (does the validator handle inline SVG correctly?).
  • Bad value “tablist” for attribute “role” on element “nav”. I'm not sure about, patrickhlauke will likely know.
  • Element “img” is missing required attribute “src”. is a false positive, due to how we use Holder.js.
  • Element “legend” not allowed as child of element “div” in this context.* I'm not sure about, I'd have to run tests locally to find the context.

I don't have an issue with merging now and then removing some ignores later.

@XhmikosR
Copy link
Member Author

XhmikosR commented Oct 7, 2017

@Johann-S: Travis has Java so it will run there. See also this PR's Travis builds :)

@XhmikosR
Copy link
Member Author

XhmikosR commented Oct 8, 2017

I'm gonna merge this but I still think we need to go through our ignores.

For example, the error about title on circle seems legit to me and it's the issue I was telling @Johann-S the other day on Slack; this is non standard.

@XhmikosR XhmikosR changed the title Switch back to vnu-jar for HTML validation Add back vnu-jar for HTML validation Oct 8, 2017
@XhmikosR XhmikosR merged commit 09f403f into v4-dev Oct 8, 2017
@XhmikosR XhmikosR deleted the html-linting branch October 8, 2017 16:08
@mdo mdo mentioned this pull request Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants