Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: htmlhint/HTMLHint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.14.0
Choose a base ref
...
head repository: htmlhint/HTMLHint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.14.1
Choose a head ref
  • 15 commits
  • 15 files changed
  • 3 contributors

Commits on Jun 1, 2020

  1. chore(deps-dev): bump nyc from 15.0.1 to 15.1.0 (#439)

    Bumps [nyc](https://github.com/istanbuljs/nyc) from 15.0.1 to 15.1.0.
    - [Release notes](https://github.com/istanbuljs/nyc/releases)
    - [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
    - [Commits](istanbuljs/nyc@v15.0.1...v15.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 1, 2020

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    823c09a View commit details
  2. test: shrink down test file (#442)

    * test: create example.html
    
    * test: test json formatter against example.html
    
    * test: test formatters against example.html
    
    * test: fix windows backslash checking
    Shinigami authored Jun 1, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d6e5861 View commit details

Commits on Jun 25, 2020

  1. chore(deps-dev): bump @rollup/plugin-commonjs from 12.0.0 to 13.0.0 (#…

    …451)
    
    Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins) from 12.0.0 to 13.0.0.
    - [Release notes](https://github.com/rollup/plugins/releases)
    - [Commits](rollup/plugins@commonjs-v12.0.0...commonjs-v13.0.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f0c4def View commit details
  2. chore(deps-dev): bump rollup from 2.12.0 to 2.18.0 (#465)

    Bumps [rollup](https://github.com/rollup/rollup) from 2.12.0 to 2.18.0.
    - [Release notes](https://github.com/rollup/rollup/releases)
    - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
    - [Commits](rollup/rollup@v2.12.0...v2.18.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    1a5ee64 View commit details
  3. chore(deps-dev): bump @typescript-eslint/parser from 3.0.2 to 3.4.0 (#…

    …473)
    
    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 3.0.2 to 3.4.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.4.0/packages/parser)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    618b513 View commit details
  4. chore(deps-dev): bump @typescript-eslint/eslint-plugin (#471)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.0.2 to 3.4.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v3.4.0/packages/eslint-plugin)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e1024e4 View commit details
  5. chore(deps-dev): bump eslint from 7.1.0 to 7.3.1 (#472)

    Bumps [eslint](https://github.com/eslint/eslint) from 7.1.0 to 7.3.1.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.1.0...v7.3.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f7a65f9 View commit details
  6. chore(deps-dev): bump @rollup/plugin-node-resolve from 8.0.0 to 8.1.0 (

    …#470)
    
    Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 8.0.0 to 8.1.0.
    - [Release notes](https://github.com/rollup/plugins/releases)
    - [Commits](rollup/plugins@node-resolve-v8.0.0...node-resolve-v8.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d5fcc46 View commit details
  7. chore(deps-dev): bump lint-staged from 10.2.7 to 10.2.11 (#467)

    Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.2.7 to 10.2.11.
    - [Release notes](https://github.com/okonet/lint-staged/releases)
    - [Commits](lint-staged/lint-staged@v10.2.7...v10.2.11)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020
    Copy the full SHA
    67d5e47 View commit details
  8. chore(deps-dev): bump eslint-plugin-prettier from 3.1.3 to 3.1.4 (#462)

    Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.1.3 to 3.1.4.
    - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
    - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
    - [Commits](prettier/eslint-plugin-prettier@v3.1.3...v3.1.4)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020
    Copy the full SHA
    2cf5ff4 View commit details
  9. chore(deps-dev): bump typescript from 3.9.3 to 3.9.5 (#459)

    Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.3 to 3.9.5.
    - [Release notes](https://github.com/Microsoft/TypeScript/releases)
    - [Commits](microsoft/TypeScript@v3.9.3...v3.9.5)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1a4356a View commit details
  10. chore(deps-dev): bump @types/glob from 7.1.1 to 7.1.2 (#452)

    Bumps [@types/glob](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/glob) from 7.1.1 to 7.1.2.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/glob)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ba4ad2e View commit details
  11. chore: update glob types (#449)

    Shinigami authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a410107 View commit details
  12. fix: windows path separator (#443)

    * fix: fix windows path separator
    
    * test: remove TODOs
    Shinigami authored Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8048600 View commit details
  13. chore(release): 0.14.1 [skip ci]

    ## [0.14.1](v0.14.0...v0.14.1) (2020-06-25)
    
    ### Bug Fixes
    
    * windows path separator ([#443](#443)) ([8048600](8048600))
    semantic-release-bot committed Jun 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d4d9694 View commit details
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [0.14.1](https://github.com/htmlhint/HTMLHint/compare/v0.14.0...v0.14.1) (2020-06-25)


### Bug Fixes

* windows path separator ([#443](https://github.com/htmlhint/HTMLHint/issues/443)) ([8048600](https://github.com/htmlhint/HTMLHint/commit/8048600e5b1568d4a4b469e822bd72a94502b242))

# [0.14.0](https://github.com/htmlhint/HTMLHint/compare/v0.13.1...v0.14.0) (2020-05-31)


736 changes: 245 additions & 491 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "htmlhint",
"version": "0.14.0",
"version": "0.14.1",
"description": "The Static Code Analysis Tool for your HTML",
"repository": {
"type": "git",
@@ -70,38 +70,38 @@
"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@rollup/plugin-commonjs": "12.0.0",
"@rollup/plugin-node-resolve": "8.0.0",
"@rollup/plugin-commonjs": "13.0.0",
"@rollup/plugin-node-resolve": "8.1.0",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/commit-analyzer": "8.0.1",
"@semantic-release/git": "9.0.0",
"@semantic-release/github": "7.0.7",
"@semantic-release/npm": "7.0.5",
"@semantic-release/release-notes-generator": "9.0.1",
"@types/async": "3.2.3",
"@types/glob": "7.1.1",
"@types/glob": "7.1.2",
"@types/parse-glob": "3.0.29",
"@types/request": "2.48.5",
"@types/xml": "1.0.5",
"@typescript-eslint/eslint-plugin": "3.0.2",
"@typescript-eslint/parser": "3.0.2",
"@typescript-eslint/eslint-plugin": "3.4.0",
"@typescript-eslint/parser": "3.4.0",
"commitizen": "4.1.2",
"commitlint": "8.3.5",
"eslint": "7.1.0",
"eslint": "7.3.1",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-prettier": "3.1.3",
"eslint-plugin-prettier": "3.1.4",
"expect.js": "0.3.1",
"husky": "4.2.5",
"lint-staged": "10.2.7",
"lint-staged": "10.2.11",
"mocha": "7.2.0",
"nyc": "15.0.1",
"nyc": "15.1.0",
"prettier": "2.0.5",
"pretty-quick": "2.0.1",
"rollup": "2.12.0",
"rollup": "2.18.0",
"rollup-plugin-babel": "4.4.0",
"rollup-plugin-terser": "6.1.0",
"semantic-release": "17.0.8",
"typescript": "3.9.3"
"typescript": "3.9.5"
},
"release": {
"plugins": [
12 changes: 10 additions & 2 deletions src/cli/htmlhint.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ import * as chalk from 'chalk'
import * as program from 'commander'
import { existsSync, readFileSync, statSync } from 'fs'
import * as glob from 'glob'
import { IGlob } from 'glob'
import { type as osType } from 'os'
import * as parseGlob from 'parse-glob'
import { dirname, resolve, sep } from 'path'
import * as request from 'request'
@@ -18,6 +20,8 @@ const formatter: Formatter = require('./formatter')

const pkg = require('../../package.json')

const OS_TYPE = osType()

function map(val: string) {
const objMap: { [name: string]: string | true } = {}
val.split(',').forEach((item) => {
@@ -428,8 +432,7 @@ function walkPath(
})
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const walk: any = glob(
const walk: IGlob = glob(
pattern,
{
cwd: base,
@@ -446,6 +449,11 @@ function walkPath(

walk.on('match', (file: string) => {
base = base.replace(/^.\//, '')

if (OS_TYPE === 'Windows_NT') {
base = base.replace(/\//g, '\\')
}

callback(base + file)
})
}
9 changes: 2 additions & 7 deletions test/cli/formatters/checkstyle.spec.js
Original file line number Diff line number Diff line change
@@ -9,20 +9,15 @@ describe('CLI', () => {
it('should have stdout output with formatter checkstyle', (done) => {
const expected = fs
.readFileSync(path.resolve(__dirname, 'checkstyle.xml'), 'utf8')
.replace(
'{{path}}',
path.resolve(__dirname, '../../html/executable.html')
)
// TODO: we need to fix windows backslash
.replace('html\\executable.html', 'html/executable.html')
.replace('{{path}}', path.resolve(__dirname, 'example.html'))

const expectedParts = expected.split('\n')

ChildProcess.exec(
[
'node',
path.resolve(__dirname, '../../../bin/htmlhint'),
path.resolve(__dirname, '../../html/executable.html'),
path.resolve(__dirname, 'example.html'),
'--format',
'checkstyle',
].join(' '),
100 changes: 14 additions & 86 deletions test/cli/formatters/checkstyle.xml

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions test/cli/formatters/compact.spec.js
Original file line number Diff line number Diff line change
@@ -11,10 +11,7 @@ describe('CLI', () => {
.readFileSync(path.resolve(__dirname, 'compact.txt'), 'utf8')
.replace(
/\{\{path\}\}/g,
path
.resolve(__dirname, '../../html/executable.html')
// TODO: we need to fix windows backslash
.replace('html\\executable.html', 'html/executable.html')
path.resolve(__dirname, '../../html/executable.html')
)
.replace(/\\u001b/g, '\u001b')

29 changes: 29 additions & 0 deletions test/cli/formatters/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div bad='' bad=''></div>
<div bad='' bad=''></div>
<input type="text"></input>
<div class"foo">

</div>
</div>
</hello>
</test>
</div>
<test>
<hello>
<div>
<div class='' what='' something=''></div>
</div>
</hello>
</test>
</div>
</bad>
</bad>
</body>
</html>
2 changes: 1 addition & 1 deletion test/cli/formatters/html.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<html><head><title>HTML Hint Violation Report</title></head><body><center><h2>Violation Report</h2></center><table border="1"><tr><th>Number#</th><th>File Name</th><th>Line Number</th><th>Message</th></tr><tr><td>1</td><td>{{path}}</td><td>8</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>2</td><td>{{path}}</td><td>8</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>3</td><td>{{path}}</td><td>8</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>4</td><td>{{path}}</td><td>9</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>5</td><td>{{path}}</td><td>9</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>6</td><td>{{path}}</td><td>9</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>7</td><td>{{path}}</td><td>10</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>8</td><td>{{path}}</td><td>10</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>9</td><td>{{path}}</td><td>10</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>10</td><td>{{path}}</td><td>11</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>11</td><td>{{path}}</td><td>11</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>12</td><td>{{path}}</td><td>11</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>13</td><td>{{path}}</td><td>12</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>14</td><td>{{path}}</td><td>12</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>15</td><td>{{path}}</td><td>12</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>16</td><td>{{path}}</td><td>13</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>17</td><td>{{path}}</td><td>13</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>18</td><td>{{path}}</td><td>13</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>19</td><td>{{path}}</td><td>14</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>20</td><td>{{path}}</td><td>14</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>21</td><td>{{path}}</td><td>14</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>22</td><td>{{path}}</td><td>15</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>23</td><td>{{path}}</td><td>15</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>24</td><td>{{path}}</td><td>15</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>25</td><td>{{path}}</td><td>16</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>26</td><td>{{path}}</td><td>16</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>27</td><td>{{path}}</td><td>16</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>28</td><td>{{path}}</td><td>17</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>29</td><td>{{path}}</td><td>17</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>30</td><td>{{path}}</td><td>17</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>31</td><td>{{path}}</td><td>18</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>32</td><td>{{path}}</td><td>18</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>33</td><td>{{path}}</td><td>18</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>34</td><td>{{path}}</td><td>19</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>35</td><td>{{path}}</td><td>19</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>36</td><td>{{path}}</td><td>19</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>37</td><td>{{path}}</td><td>20</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>38</td><td>{{path}}</td><td>20</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>39</td><td>{{path}}</td><td>20</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>40</td><td>{{path}}</td><td>21</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>41</td><td>{{path}}</td><td>21</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>42</td><td>{{path}}</td><td>21</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>43</td><td>{{path}}</td><td>22</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>44</td><td>{{path}}</td><td>22</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>45</td><td>{{path}}</td><td>22</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>46</td><td>{{path}}</td><td>23</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>47</td><td>{{path}}</td><td>23</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>48</td><td>{{path}}</td><td>23</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>49</td><td>{{path}}</td><td>24</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>50</td><td>{{path}}</td><td>24</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>51</td><td>{{path}}</td><td>24</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>52</td><td>{{path}}</td><td>25</td><td>Tag must be paired, no start tag: [ </input> ]</td></tr><tr><td>53</td><td>{{path}}</td><td>26</td><td>Special characters must be escaped : [ < ].</td></tr><tr><td>54</td><td>{{path}}</td><td>26</td><td>Special characters must be escaped : [ > ].</td></tr><tr><td>55</td><td>{{path}}</td><td>28</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>56</td><td>{{path}}</td><td>29</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>57</td><td>{{path}}</td><td>30</td><td>Tag must be paired, no start tag: [ </hello> ]</td></tr><tr><td>58</td><td>{{path}}</td><td>31</td><td>Tag must be paired, no start tag: [ </test> ]</td></tr><tr><td>59</td><td>{{path}}</td><td>32</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>60</td><td>{{path}}</td><td>38</td><td>The value of attribute [ class ] must be in double quotes.</td></tr><tr><td>61</td><td>{{path}}</td><td>38</td><td>The value of attribute [ what ] must be in double quotes.</td></tr><tr><td>62</td><td>{{path}}</td><td>38</td><td>The value of attribute [ something ] must be in double quotes.</td></tr><tr><td>63</td><td>{{path}}</td><td>44</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>64</td><td>{{path}}</td><td>50</td><td>The value of attribute [ class ] must be in double quotes.</td></tr><tr><td>65</td><td>{{path}}</td><td>50</td><td>The value of attribute [ what ] must be in double quotes.</td></tr><tr><td>66</td><td>{{path}}</td><td>50</td><td>The value of attribute [ something ] must be in double quotes.</td></tr><tr><td>67</td><td>{{path}}</td><td>56</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>68</td><td>{{path}}</td><td>62</td><td>The value of attribute [ class ] must be in double quotes.</td></tr><tr><td>69</td><td>{{path}}</td><td>62</td><td>The value of attribute [ what ] must be in double quotes.</td></tr><tr><td>70</td><td>{{path}}</td><td>62</td><td>The value of attribute [ something ] must be in double quotes.</td></tr><tr><td>71</td><td>{{path}}</td><td>68</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>72</td><td>{{path}}</td><td>74</td><td>The value of attribute [ class ] must be in double quotes.</td></tr><tr><td>73</td><td>{{path}}</td><td>74</td><td>The value of attribute [ what ] must be in double quotes.</td></tr><tr><td>74</td><td>{{path}}</td><td>74</td><td>The value of attribute [ something ] must be in double quotes.</td></tr><tr><td>75</td><td>{{path}}</td><td>80</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>76</td><td>{{path}}</td><td>81</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>77</td><td>{{path}}</td><td>82</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>78</td><td>{{path}}</td><td>83</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>79</td><td>{{path}}</td><td>84</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>80</td><td>{{path}}</td><td>85</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>81</td><td>{{path}}</td><td>86</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>82</td><td>{{path}}</td><td>87</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>83</td><td>{{path}}</td><td>88</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>84</td><td>{{path}}</td><td>89</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>85</td><td>{{path}}</td><td>90</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>86</td><td>{{path}}</td><td>91</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>87</td><td>{{path}}</td><td>92</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>88</td><td>{{path}}</td><td>93</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>89</td><td>{{path}}</td><td>94</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>90</td><td>{{path}}</td><td>95</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>91</td><td>{{path}}</td><td>96</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>92</td><td>{{path}}</td><td>97</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr></table></body></html>
<html><head><title>HTML Hint Violation Report</title></head><body><center><h2>Violation Report</h2></center><table border="1"><tr><th>Number#</th><th>File Name</th><th>Line Number</th><th>Message</th></tr><tr><td>1</td><td>{{path}}</td><td>8</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>2</td><td>{{path}}</td><td>8</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>3</td><td>{{path}}</td><td>8</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>4</td><td>{{path}}</td><td>9</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>5</td><td>{{path}}</td><td>9</td><td>The value of attribute [ bad ] must be in double quotes.</td></tr><tr><td>6</td><td>{{path}}</td><td>9</td><td>Duplicate of attribute name [ bad ] was found.</td></tr><tr><td>7</td><td>{{path}}</td><td>10</td><td>Tag must be paired, no start tag: [ </input> ]</td></tr><tr><td>8</td><td>{{path}}</td><td>11</td><td>Special characters must be escaped : [ < ].</td></tr><tr><td>9</td><td>{{path}}</td><td>11</td><td>Special characters must be escaped : [ > ].</td></tr><tr><td>10</td><td>{{path}}</td><td>13</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>11</td><td>{{path}}</td><td>14</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>12</td><td>{{path}}</td><td>15</td><td>Tag must be paired, no start tag: [ </hello> ]</td></tr><tr><td>13</td><td>{{path}}</td><td>16</td><td>Tag must be paired, no start tag: [ </test> ]</td></tr><tr><td>14</td><td>{{path}}</td><td>17</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>15</td><td>{{path}}</td><td>21</td><td>The value of attribute [ class ] must be in double quotes.</td></tr><tr><td>16</td><td>{{path}}</td><td>21</td><td>The value of attribute [ what ] must be in double quotes.</td></tr><tr><td>17</td><td>{{path}}</td><td>21</td><td>The value of attribute [ something ] must be in double quotes.</td></tr><tr><td>18</td><td>{{path}}</td><td>25</td><td>Tag must be paired, no start tag: [ </div> ]</td></tr><tr><td>19</td><td>{{path}}</td><td>26</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr><tr><td>20</td><td>{{path}}</td><td>27</td><td>Tag must be paired, no start tag: [ </bad> ]</td></tr></table></body></html>
10 changes: 2 additions & 8 deletions test/cli/formatters/html.spec.js
Original file line number Diff line number Diff line change
@@ -9,21 +9,15 @@ describe('CLI', () => {
it('should have stdout output with formatter html', (done) => {
const expected = fs
.readFileSync(path.resolve(__dirname, 'html.html'), 'utf8')
.replace(
/\{\{path\}\}/g,
path
.resolve(__dirname, '../../html/executable.html')
// TODO: we need to fix windows backslash
.replace('html\\executable.html', 'html/executable.html')
)
.replace(/\{\{path\}\}/g, path.resolve(__dirname, 'example.html'))

const expectedParts = expected.split('\n')

ChildProcess.exec(
[
'node',
path.resolve(__dirname, '../../../bin/htmlhint'),
path.resolve(__dirname, '../../html/executable.html'),
path.resolve(__dirname, 'example.html'),
'--format',
'html',
].join(' '),
1,052 changes: 58 additions & 994 deletions test/cli/formatters/json.json

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions test/cli/formatters/json.spec.js
Original file line number Diff line number Diff line change
@@ -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

4 changes: 2 additions & 2 deletions test/cli/formatters/junit.spec.js
Original file line number Diff line number Diff line change
@@ -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('<?xml version="1.0" encoding="UTF-8"?>')
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: [ </bad> ] (tag-pair)'
)
6 changes: 3 additions & 3 deletions test/cli/formatters/markdown.spec.js
Original file line number Diff line number Diff line change
@@ -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: [ </bad> ] (tag-pair)'
)
5 changes: 1 addition & 4 deletions test/cli/formatters/unix.spec.js
Original file line number Diff line number Diff line change
@@ -11,10 +11,7 @@ describe('CLI', () => {
.readFileSync(path.resolve(__dirname, 'unix.txt'), 'utf8')
.replace(
/\{\{path\}\}/g,
path
.resolve(__dirname, '../../html/executable.html')
// TODO: we need to fix windows backslash
.replace('html\\executable.html', 'html/executable.html')
path.resolve(__dirname, '../../html/executable.html')
)
.replace(/\\u001b/g, '\u001b')