diff --git a/test/cli/formatters/checkstyle.spec.js b/test/cli/formatters/checkstyle.spec.js index 67c231df5..256117bf2 100644 --- a/test/cli/formatters/checkstyle.spec.js +++ b/test/cli/formatters/checkstyle.spec.js @@ -11,10 +11,11 @@ describe('CLI', () => { .readFileSync(path.resolve(__dirname, 'checkstyle.xml'), 'utf8') .replace( '{{path}}', - path.resolve(__dirname, '../../html/executable.html') + path + .resolve(__dirname, 'example.html') + // TODO: we need to fix windows backslash + .replace('\\example', '/example') ) - // TODO: we need to fix windows backslash - .replace('html\\executable.html', 'html/executable.html') const expectedParts = expected.split('\n') @@ -22,7 +23,7 @@ describe('CLI', () => { [ 'node', path.resolve(__dirname, '../../../bin/htmlhint'), - path.resolve(__dirname, '../../html/executable.html'), + path.resolve(__dirname, 'example.html'), '--format', 'checkstyle', ].join(' '), diff --git a/test/cli/formatters/checkstyle.xml b/test/cli/formatters/checkstyle.xml index 3813d6383..aa96f0fc7 100644 --- a/test/cli/formatters/checkstyle.xml +++ b/test/cli/formatters/checkstyle.xml @@ -7,91 +7,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/test/cli/formatters/example.html b/test/cli/formatters/example.html new file mode 100644 index 000000000..0a840d154 --- /dev/null +++ b/test/cli/formatters/example.html @@ -0,0 +1,29 @@ + + + + + Document + + +
+
+ +
+ +
+ + + + + + +
+
+
+
+
+ + + + + diff --git a/test/cli/formatters/html.html b/test/cli/formatters/html.html index 5bbde2e2a..b335e82d2 100644 --- a/test/cli/formatters/html.html +++ b/test/cli/formatters/html.html @@ -1 +1 @@ -HTML Hint Violation Report

Violation Report

Number#File NameLine NumberMessage
1{{path}}8The value of attribute [ bad ] must be in double quotes.
2{{path}}8The value of attribute [ bad ] must be in double quotes.
3{{path}}8Duplicate of attribute name [ bad ] was found.
4{{path}}9The value of attribute [ bad ] must be in double quotes.
5{{path}}9The value of attribute [ bad ] must be in double quotes.
6{{path}}9Duplicate of attribute name [ bad ] was found.
7{{path}}10The value of attribute [ bad ] must be in double quotes.
8{{path}}10The value of attribute [ bad ] must be in double quotes.
9{{path}}10Duplicate of attribute name [ bad ] was found.
10{{path}}11The value of attribute [ bad ] must be in double quotes.
11{{path}}11The value of attribute [ bad ] must be in double quotes.
12{{path}}11Duplicate of attribute name [ bad ] was found.
13{{path}}12The value of attribute [ bad ] must be in double quotes.
14{{path}}12The value of attribute [ bad ] must be in double quotes.
15{{path}}12Duplicate of attribute name [ bad ] was found.
16{{path}}13The value of attribute [ bad ] must be in double quotes.
17{{path}}13The value of attribute [ bad ] must be in double quotes.
18{{path}}13Duplicate of attribute name [ bad ] was found.
19{{path}}14The value of attribute [ bad ] must be in double quotes.
20{{path}}14The value of attribute [ bad ] must be in double quotes.
21{{path}}14Duplicate of attribute name [ bad ] was found.
22{{path}}15The value of attribute [ bad ] must be in double quotes.
23{{path}}15The value of attribute [ bad ] must be in double quotes.
24{{path}}15Duplicate of attribute name [ bad ] was found.
25{{path}}16The value of attribute [ bad ] must be in double quotes.
26{{path}}16The value of attribute [ bad ] must be in double quotes.
27{{path}}16Duplicate of attribute name [ bad ] was found.
28{{path}}17The value of attribute [ bad ] must be in double quotes.
29{{path}}17The value of attribute [ bad ] must be in double quotes.
30{{path}}17Duplicate of attribute name [ bad ] was found.
31{{path}}18The value of attribute [ bad ] must be in double quotes.
32{{path}}18The value of attribute [ bad ] must be in double quotes.
33{{path}}18Duplicate of attribute name [ bad ] was found.
34{{path}}19The value of attribute [ bad ] must be in double quotes.
35{{path}}19The value of attribute [ bad ] must be in double quotes.
36{{path}}19Duplicate of attribute name [ bad ] was found.
37{{path}}20The value of attribute [ bad ] must be in double quotes.
38{{path}}20The value of attribute [ bad ] must be in double quotes.
39{{path}}20Duplicate of attribute name [ bad ] was found.
40{{path}}21The value of attribute [ bad ] must be in double quotes.
41{{path}}21The value of attribute [ bad ] must be in double quotes.
42{{path}}21Duplicate of attribute name [ bad ] was found.
43{{path}}22The value of attribute [ bad ] must be in double quotes.
44{{path}}22The value of attribute [ bad ] must be in double quotes.
45{{path}}22Duplicate of attribute name [ bad ] was found.
46{{path}}23The value of attribute [ bad ] must be in double quotes.
47{{path}}23The value of attribute [ bad ] must be in double quotes.
48{{path}}23Duplicate of attribute name [ bad ] was found.
49{{path}}24The value of attribute [ bad ] must be in double quotes.
50{{path}}24The value of attribute [ bad ] must be in double quotes.
51{{path}}24Duplicate of attribute name [ bad ] was found.
52{{path}}25Tag must be paired, no start tag: [ ]
53{{path}}26Special characters must be escaped : [ < ].
54{{path}}26Special characters must be escaped : [ > ].
55{{path}}28Tag must be paired, no start tag: [ ]
56{{path}}29Tag must be paired, no start tag: [ ]
57{{path}}30Tag must be paired, no start tag: [ ]
58{{path}}31Tag must be paired, no start tag: [ ]
59{{path}}32Tag must be paired, no start tag: [ ]
60{{path}}38The value of attribute [ class ] must be in double quotes.
61{{path}}38The value of attribute [ what ] must be in double quotes.
62{{path}}38The value of attribute [ something ] must be in double quotes.
63{{path}}44Tag must be paired, no start tag: [ ]
64{{path}}50The value of attribute [ class ] must be in double quotes.
65{{path}}50The value of attribute [ what ] must be in double quotes.
66{{path}}50The value of attribute [ something ] must be in double quotes.
67{{path}}56Tag must be paired, no start tag: [ ]
68{{path}}62The value of attribute [ class ] must be in double quotes.
69{{path}}62The value of attribute [ what ] must be in double quotes.
70{{path}}62The value of attribute [ something ] must be in double quotes.
71{{path}}68Tag must be paired, no start tag: [ ]
72{{path}}74The value of attribute [ class ] must be in double quotes.
73{{path}}74The value of attribute [ what ] must be in double quotes.
74{{path}}74The value of attribute [ something ] must be in double quotes.
75{{path}}80Tag must be paired, no start tag: [ ]
76{{path}}81Tag must be paired, no start tag: [ ]
77{{path}}82Tag must be paired, no start tag: [ ]
78{{path}}83Tag must be paired, no start tag: [ ]
79{{path}}84Tag must be paired, no start tag: [ ]
80{{path}}85Tag must be paired, no start tag: [ ]
81{{path}}86Tag must be paired, no start tag: [ ]
82{{path}}87Tag must be paired, no start tag: [ ]
83{{path}}88Tag must be paired, no start tag: [ ]
84{{path}}89Tag must be paired, no start tag: [ ]
85{{path}}90Tag must be paired, no start tag: [ ]
86{{path}}91Tag must be paired, no start tag: [ ]
87{{path}}92Tag must be paired, no start tag: [ ]
88{{path}}93Tag must be paired, no start tag: [ ]
89{{path}}94Tag must be paired, no start tag: [ ]
90{{path}}95Tag must be paired, no start tag: [ ]
91{{path}}96Tag must be paired, no start tag: [ ]
92{{path}}97Tag must be paired, no start tag: [ ]
+HTML Hint Violation Report

Violation Report

Number#File NameLine NumberMessage
1{{path}}8The value of attribute [ bad ] must be in double quotes.
2{{path}}8The value of attribute [ bad ] must be in double quotes.
3{{path}}8Duplicate of attribute name [ bad ] was found.
4{{path}}9The value of attribute [ bad ] must be in double quotes.
5{{path}}9The value of attribute [ bad ] must be in double quotes.
6{{path}}9Duplicate of attribute name [ bad ] was found.
7{{path}}10Tag must be paired, no start tag: [ ]
8{{path}}11Special characters must be escaped : [ < ].
9{{path}}11Special characters must be escaped : [ > ].
10{{path}}13Tag must be paired, no start tag: [ ]
11{{path}}14Tag must be paired, no start tag: [ ]
12{{path}}15Tag must be paired, no start tag: [ ]
13{{path}}16Tag must be paired, no start tag: [ ]
14{{path}}17Tag must be paired, no start tag: [ ]
15{{path}}21The value of attribute [ class ] must be in double quotes.
16{{path}}21The value of attribute [ what ] must be in double quotes.
17{{path}}21The value of attribute [ something ] must be in double quotes.
18{{path}}25Tag must be paired, no start tag: [ ]
19{{path}}26Tag must be paired, no start tag: [ ]
20{{path}}27Tag must be paired, no start tag: [ ]
diff --git a/test/cli/formatters/html.spec.js b/test/cli/formatters/html.spec.js index 97baec8e7..519b77883 100644 --- a/test/cli/formatters/html.spec.js +++ b/test/cli/formatters/html.spec.js @@ -12,9 +12,9 @@ describe('CLI', () => { .replace( /\{\{path\}\}/g, path - .resolve(__dirname, '../../html/executable.html') + .resolve(__dirname, 'example.html') // TODO: we need to fix windows backslash - .replace('html\\executable.html', 'html/executable.html') + .replace('\\example', '/example') ) const expectedParts = expected.split('\n') @@ -23,7 +23,7 @@ describe('CLI', () => { [ 'node', path.resolve(__dirname, '../../../bin/htmlhint'), - path.resolve(__dirname, '../../html/executable.html'), + path.resolve(__dirname, 'example.html'), '--format', 'html', ].join(' '), diff --git a/test/cli/formatters/json.json b/test/cli/formatters/json.json index 313fd694f..8744fe391 100644 --- a/test/cli/formatters/json.json +++ b/test/cli/formatters/json.json @@ -80,597 +80,12 @@ "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" } }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 10, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 10, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 10, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 11, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 11, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 11, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 12, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 12, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 12, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 13, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 13, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 13, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 14, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 14, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 14, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 15, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 15, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 15, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 16, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 16, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 16, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 17, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 17, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 17, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 18, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 18, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 18, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 19, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 19, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 19, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 20, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 20, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 20, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 21, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 21, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 21, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 22, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 22, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 22, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 23, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 23, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 23, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 24, - "col": 7, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ bad ] must be in double quotes.", - "raw": " bad=''", - "evidence": "
", - "line": 24, - "col": 14, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Duplicate of attribute name [ bad ] was found.", - "raw": " bad=''", - "evidence": "
", - "line": 24, - "col": 14, - "rule": { - "id": "attr-no-duplication", - "description": "Elements cannot have duplicate attributes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-no-duplication" - } - }, { "type": "error", "message": "Tag must be paired, no start tag: [ ]", "raw": "", "evidence": " ", - "line": 25, + "line": 10, "col": 22, "rule": { "id": "tag-pair", @@ -680,193 +95,37 @@ }, { "type": "error", - "message": "Special characters must be escaped : [ < ].", - "raw": "\n
\n\n ", - "evidence": "
", - "line": 26, - "col": 3, - "rule": { - "id": "spec-char-escape", - "description": "Special characters must be escaped.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/spec-char-escape" - } - }, - { - "type": "error", - "message": "Special characters must be escaped : [ > ].", - "raw": "\n
\n\n ", - "evidence": "
", - "line": 26, - "col": 18, - "rule": { - "id": "spec-char-escape", - "description": "Special characters must be escaped.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/spec-char-escape" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [
]", - "raw": "
", - "evidence": "
", - "line": 28, - "col": 11, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [
]", - "raw": "", - "evidence": " ", - "line": 29, - "col": 9, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": " ", - "line": 30, - "col": 7, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": " ", - "line": 31, - "col": 5, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": " ", - "line": 32, - "col": 3, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "The value of attribute [ class ] must be in double quotes.", - "raw": " class=''", - "evidence": "
", - "line": 38, - "col": 19, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ what ] must be in double quotes.", - "raw": " what=''", - "evidence": "
", - "line": 38, - "col": 28, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ something ] must be in double quotes.", - "raw": " something=''", - "evidence": "
", - "line": 38, - "col": 36, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": " ", - "line": 44, - "col": 3, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "The value of attribute [ class ] must be in double quotes.", - "raw": " class=''", - "evidence": "
", - "line": 50, - "col": 19, - "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" - } - }, - { - "type": "error", - "message": "The value of attribute [ what ] must be in double quotes.", - "raw": " what=''", - "evidence": "
", - "line": 50, - "col": 28, + "message": "Special characters must be escaped : [ < ].", + "raw": "\n
\n\n ", + "evidence": "
", + "line": 11, + "col": 3, "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" + "id": "spec-char-escape", + "description": "Special characters must be escaped.", + "link": "https://github.com/thedaviddias/HTMLHint/wiki/spec-char-escape" } }, { "type": "error", - "message": "The value of attribute [ something ] must be in double quotes.", - "raw": " something=''", - "evidence": "
", - "line": 50, - "col": 36, + "message": "Special characters must be escaped : [ > ].", + "raw": "\n
\n\n ", + "evidence": "
", + "line": 11, + "col": 18, "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" + "id": "spec-char-escape", + "description": "Special characters must be escaped.", + "link": "https://github.com/thedaviddias/HTMLHint/wiki/spec-char-escape" } }, { "type": "error", "message": "Tag must be paired, no start tag: [
]", "raw": "
", - "evidence": "
", - "line": 56, - "col": 3, + "evidence": "
", + "line": 13, + "col": 11, "rule": { "id": "tag-pair", "description": "Tag must be paired.", @@ -875,41 +134,41 @@ }, { "type": "error", - "message": "The value of attribute [ class ] must be in double quotes.", - "raw": " class=''", - "evidence": "
", - "line": 62, - "col": 19, + "message": "Tag must be paired, no start tag: [ ]", + "raw": "", + "evidence": " ", + "line": 14, + "col": 9, "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" + "id": "tag-pair", + "description": "Tag must be paired.", + "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" } }, { "type": "error", - "message": "The value of attribute [ what ] must be in double quotes.", - "raw": " what=''", - "evidence": "
", - "line": 62, - "col": 28, + "message": "Tag must be paired, no start tag: [ ]", + "raw": "", + "evidence": " ", + "line": 15, + "col": 7, "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" + "id": "tag-pair", + "description": "Tag must be paired.", + "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" } }, { "type": "error", - "message": "The value of attribute [ something ] must be in double quotes.", - "raw": " something=''", - "evidence": "
", - "line": 62, - "col": 36, + "message": "Tag must be paired, no start tag: [ ]", + "raw": "", + "evidence": " ", + "line": 16, + "col": 5, "rule": { - "id": "attr-value-double-quotes", - "description": "Attribute values must be in double quotes.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/attr-value-double-quotes" + "id": "tag-pair", + "description": "Tag must be paired.", + "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" } }, { @@ -917,7 +176,7 @@ "message": "Tag must be paired, no start tag: [ ]", "raw": "", "evidence": " ", - "line": 68, + "line": 17, "col": 3, "rule": { "id": "tag-pair", @@ -929,9 +188,9 @@ "type": "error", "message": "The value of attribute [ class ] must be in double quotes.", "raw": " class=''", - "evidence": "
", - "line": 74, - "col": 19, + "evidence": "
", + "line": 21, + "col": 15, "rule": { "id": "attr-value-double-quotes", "description": "Attribute values must be in double quotes.", @@ -942,9 +201,9 @@ "type": "error", "message": "The value of attribute [ what ] must be in double quotes.", "raw": " what=''", - "evidence": "
", - "line": 74, - "col": 28, + "evidence": "
", + "line": 21, + "col": 24, "rule": { "id": "attr-value-double-quotes", "description": "Attribute values must be in double quotes.", @@ -955,9 +214,9 @@ "type": "error", "message": "The value of attribute [ something ] must be in double quotes.", "raw": " something=''", - "evidence": "
", - "line": 74, - "col": 36, + "evidence": "
", + "line": 21, + "col": 32, "rule": { "id": "attr-value-double-quotes", "description": "Attribute values must be in double quotes.", @@ -969,7 +228,7 @@ "message": "Tag must be paired, no start tag: [ ]", "raw": "", "evidence": " ", - "line": 80, + "line": 25, "col": 3, "rule": { "id": "tag-pair", @@ -982,202 +241,7 @@ "message": "Tag must be paired, no start tag: [ ]", "raw": "", "evidence": "", - "line": 81, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 82, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 83, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 84, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 85, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 86, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 87, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 88, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 89, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 90, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 91, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 92, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 93, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 94, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 95, - "col": 1, - "rule": { - "id": "tag-pair", - "description": "Tag must be paired.", - "link": "https://github.com/thedaviddias/HTMLHint/wiki/tag-pair" - } - }, - { - "type": "error", - "message": "Tag must be paired, no start tag: [ ]", - "raw": "", - "evidence": "", - "line": 96, + "line": 26, "col": 1, "rule": { "id": "tag-pair", @@ -1190,7 +254,7 @@ "message": "Tag must be paired, no start tag: [ ]", "raw": "", "evidence": "", - "line": 97, + "line": 27, "col": 1, "rule": { "id": "tag-pair", @@ -1199,6 +263,6 @@ } } ], - "time": 4 + "time": 2 } ] diff --git a/test/cli/formatters/json.spec.js b/test/cli/formatters/json.spec.js index 1814b74e0..7f73e35c2 100644 --- a/test/cli/formatters/json.spec.js +++ b/test/cli/formatters/json.spec.js @@ -11,11 +11,7 @@ describe('CLI', () => { .readFileSync(path.resolve(__dirname, 'json.json'), 'utf8') .replace( /\{\{path\}\}/g, - path - .resolve(__dirname, '../../html/executable.html') - .replace(/\\/g, '\\\\') - // TODO: we need to fix windows backslash - .replace('html\\\\executable.html', 'html/executable.html') + path.resolve(__dirname, 'example.html').replace(/\\/g, '\\\\') ) const expected = JSON.parse(expectedFileContent) @@ -24,7 +20,7 @@ describe('CLI', () => { [ 'node', path.resolve(__dirname, '../../../bin/htmlhint'), - path.resolve(__dirname, '../../html/executable.html'), + path.resolve(__dirname, 'example.html'), '--format', 'json', ].join(' '), @@ -36,7 +32,7 @@ describe('CLI', () => { const jsonStdout = JSON.parse(stdout) expect(jsonStdout[0]).to.be.an('object') - expect(jsonStdout[0].file).to.contain('executable.html') + expect(jsonStdout[0].file).to.contain('example.html') const stdoutMessages = jsonStdout[0].messages diff --git a/test/cli/formatters/junit.spec.js b/test/cli/formatters/junit.spec.js index b2152a800..1954fe49d 100644 --- a/test/cli/formatters/junit.spec.js +++ b/test/cli/formatters/junit.spec.js @@ -11,7 +11,7 @@ describe('CLI', () => { [ 'node', path.resolve(__dirname, '../../../bin/htmlhint'), - path.resolve(__dirname, '../../html/executable.html'), + path.resolve(__dirname, 'example.html'), '--format', 'junit', ].join(' '), @@ -20,7 +20,7 @@ describe('CLI', () => { expect(error.code).to.be.equal(1) expect(stdout).to.contain('') - expect(stdout).to.contain('Found 92 errors') + expect(stdout).to.contain('Found 20 errors') expect(stdout).to.contain( '^ Tag must be paired, no start tag: [ ] (tag-pair)' ) diff --git a/test/cli/formatters/markdown.spec.js b/test/cli/formatters/markdown.spec.js index 9074ce3b3..ed9d7fe02 100644 --- a/test/cli/formatters/markdown.spec.js +++ b/test/cli/formatters/markdown.spec.js @@ -10,7 +10,7 @@ describe('CLI', () => { [ 'node', path.resolve(__dirname, '../../../bin/htmlhint'), - path.resolve(__dirname, '../../html/executable.html'), + path.resolve(__dirname, 'example.html'), '--format', 'markdown', ].join(' '), @@ -19,8 +19,8 @@ describe('CLI', () => { expect(error.code).to.be.equal(1) expect(stdout).to.contain('# TOC') - expect(stdout).to.contain('Found 92 errors, 0 warnings') - expect(stdout).to.contain('executable.html') + expect(stdout).to.contain('Found 20 errors, 0 warnings') + expect(stdout).to.contain('example.html') expect(stdout).to.contain( '^ Tag must be paired, no start tag: [ ] (tag-pair)' )