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

Validator Updates - 'Tighten custom element validation' and some minor changes. #1439

Merged
merged 4 commits into from
Jan 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions validator/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def GenerateValidateBin(out_dir):
var args = process.argv.slice(2);
var full_path = args[0];

if (full_path.indexOf('http://') === 0 || full_path.indexOf('https://') === 0) {
if (full_path.indexOf('http://') === 0 ||
full_path.indexOf('https://') === 0) {
var callback = function(response) {
var chunks = [];

Expand Down Expand Up @@ -270,7 +271,8 @@ def RunSmokeTest(out_dir):

# Run dist/validate on an empty file and observe that it fails.
open('%s/empty.html' % out_dir, 'w').close()
p = subprocess.Popen(['node', '%s/validate' % out_dir, '%s/empty.html' % out_dir],
p = subprocess.Popen(['node', '%s/validate' % out_dir, '%s/empty.html' %
out_dir],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
if p.returncode != 1:
Expand Down
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/amp_brightcove.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FAIL
feature_tests/amp_brightcove.html:48:2 The mandatory attribute 'data-account' missing in tag 'amp-brightcove'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-brightcove/amp-brightcove.md)
feature_tests/amp_brightcove.html:48:2 The mandatory attribute 'data-account' is missing in tag 'amp-brightcove'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-brightcove/amp-brightcove.md)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FAIL
feature_tests/amp_identification_missing.html:22:0 The mandatory attribute '⚡' missing in tag 'html ⚡ for top-level html'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
feature_tests/amp_identification_missing.html:22:0 The mandatory attribute '⚡' is missing in tag 'html ⚡ for top-level html'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
feature_tests/amp_identification_missing.html:33:7 The mandatory tag 'html ⚡ for top-level html' is missing or incorrect. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
4 changes: 2 additions & 2 deletions validator/testdata/feature_tests/amp_layouts.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FAIL
feature_tests/amp_layouts.html:41:2 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:41:2 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:51:2 Invalid value '300' for attribute 'width' in tag 'amp-img' - for layout 'FIXED_HEIGHT', set the attribute 'width' to value 'auto'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:61:2 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:61:2 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:80:2 The specified layout 'CONTAINER' is not supported by tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:83:2 The attribute 'layout' in tag 'amp-img' is set to the invalid value 'unknown'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/amp_layouts.html:113:2 The implied layout 'FIXED_HEIGHT' is not supported by tag 'amp-pixel'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-pixel.md)
Expand Down
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/amp_list.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAIL
feature_tests/amp_list.html:36:2 The attribute 'wdith' may not appear in tag 'amp-list'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-list/amp-list.md)
feature_tests/amp_list.html:41:2 The mandatory attribute 'src' missing in tag 'amp-list'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-list/amp-list.md)
feature_tests/amp_list.html:41:2 The mandatory attribute 'src' is missing in tag 'amp-list'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-list/amp-list.md)
feature_tests/amp_list.html:46:2 The implied layout 'CONTAINER' is not supported by tag 'amp-list'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-list/amp-list.md)
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/dog_doc_type.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAIL
feature_tests/dog_doc_type.html:23:0 The attribute '🐶' may not appear in tag 'html doctype'.
feature_tests/dog_doc_type.html:24:0 The mandatory attribute '⚡' missing in tag 'html ⚡ for top-level html'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
feature_tests/dog_doc_type.html:24:0 The mandatory attribute '⚡' is missing in tag 'html ⚡ for top-level html'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
feature_tests/dog_doc_type.html:35:7 The mandatory tag 'html ⚡ for top-level html' is missing or incorrect. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
14 changes: 7 additions & 7 deletions validator/testdata/feature_tests/mandatory_dimensions.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ FAIL
feature_tests/mandatory_dimensions.html:109:4 The specified layout 'CONTAINER' is not supported by tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:110:4 The specified layout 'CONTAINER' is not supported by tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:111:4 The implied layout 'CONTAINER' is not supported by tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:114:4 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:115:4 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:116:4 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:117:4 The mandatory attribute 'width' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:114:4 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:115:4 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:116:4 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:117:4 The mandatory attribute 'width' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:118:4 The attribute 'height' in tag 'amp-img' is set to the invalid value 'auto'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:119:4 The attribute 'width' in tag 'amp-img' is set to the invalid value 'auto'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:122:4 Inconsistent units for width and height in tag 'amp-img' - width is specified in 'px' whereas height is specified in 'rem'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:125:4 The mandatory attribute 'src' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:126:4 The mandatory attribute 'src' missing in tag 'amp-anim'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-anim/amp-anim.md)
feature_tests/mandatory_dimensions.html:125:4 The mandatory attribute 'src' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/mandatory_dimensions.html:126:4 The mandatory attribute 'src' is missing in tag 'amp-anim'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-anim/amp-anim.md)
feature_tests/mandatory_dimensions.html:129:4 The attribute 'srcset' may not appear in tag 'amp-audio'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-audio/amp-audio.md)
feature_tests/mandatory_dimensions.html:130:4 The attribute 'srcset' may not appear in tag 'amp-ad'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-ad.md)
feature_tests/mandatory_dimensions.html:133:4 The tag 'amp-iframe' is missing a mandatory attribute - pick one of ['src', 'srcdoc']. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/amp-iframe.md)
feature_tests/mandatory_dimensions.html:134:4 The mandatory attribute 'src' missing in tag 'amp-pixel'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-pixel.md)
feature_tests/mandatory_dimensions.html:134:4 The mandatory attribute 'src' is missing in tag 'amp-pixel'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-pixel.md)
feature_tests/mandatory_dimensions.html:137:4 The attribute 'src' may not appear in tag 'amp-fit-text'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-fit-text/amp-fit-text.md)
feature_tests/mandatory_dimensions.html:138:4 The attribute 'src' may not appear in tag 'amp-carousel'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-carousel/amp-carousel.md)
feature_tests/mandatory_dimensions.html:139:4 The attribute 'srcset' may not appear in tag 'amp-youtube'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-youtube/amp-youtube.md)
Expand Down
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/no_custom_js.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FAIL
feature_tests/no_custom_js.html:28:3 The attribute 'src' in tag 'amphtml engine v0.js script' is set to the invalid value 'https://example.com/v0-not-allowed.js'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#scrpt)
feature_tests/no_custom_js.html:29:3 The attribute 'src' in tag 'amphtml custom element' is set to the invalid value 'https://example.com/v0/not-allowed.js'.
feature_tests/no_custom_js.html:29:3 The attribute 'custom-element' in tag 'amp-access extension .js script' is set to the invalid value 'amp-foo'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-access/amp-access.md)
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/several_errors.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FAIL
feature_tests/several_errors.html:23:2 The attribute 'charset' in tag 'charset utf-8 declaration' is set to the invalid value 'pick-a-key'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs)
feature_tests/several_errors.html:26:2 The attribute 'type' in tag 'script' is set to the invalid value 'javascript'.
feature_tests/several_errors.html:32:2 The mandatory attribute 'height' missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/several_errors.html:32:2 The mandatory attribute 'height' is missing in tag 'amp-img'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-img.md)
feature_tests/several_errors.html:34:2 The attribute 'width' in tag 'amp-ad' is set to the invalid value '100%'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-ad.md)
feature_tests/several_errors.html:37:2 The attribute 'made_up_attribute' may not appear in tag 'amp-ad'. (see https://github.com/ampproject/amphtml/blob/master/builtins/amp-ad.md)
feature_tests/several_errors.html:39:7 The mandatory tag 'charset utf-8 declaration' is missing or incorrect. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs)
Expand Down
Loading