]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Move from htmllint to Travis-only vnu.jar.
authorBardi Harborow <bardi@bardiharborow.com>
Wed, 27 Sep 2017 14:41:58 +0000 (14:41 +0000)
committerXhmikosR <xhmikosr@gmail.com>
Sun, 8 Oct 2017 16:08:16 +0000 (19:08 +0300)
.travis.yml
build/.htmllintrc [deleted file]
build/htmllint.js [new file with mode: 0644]
package.json

index 57c810b0a8b776cacc5f91825f8aeee04b677a9c..5952c303ac1b65e6e01b27d7e9297e4a67ba61d9 100644 (file)
@@ -11,6 +11,7 @@ before_install:
 install:
   - bundle install --deployment --jobs=3 --retry=3
   - npm install
+  - curl -L https://github.com/validator/validator/releases/download/17.9.0/vnu.jar_17.9.0.zip | jar -x dist/vnu.jar && mv dist/vnu.jar vnu.jar
 after_success:
   - if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then npm run docs-upload-preview; fi
 stages:
diff --git a/build/.htmllintrc b/build/.htmllintrc
deleted file mode 100644 (file)
index c04658f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "attr-bans": ["align", "background", "bgcolor", "border", "frameborder", "longdesc", "marginwidth", "marginheight", "scrolling"],
-  "attr-name-style": false,
-  "attr-no-unsafe-char": false,
-  "class-style": "dash",
-  "doctype-first": true,
-  "doctype-html5": true,
-  "fig-req-figcaption": false,
-  "html-valid-content-model": false,
-  "id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
-  "id-class-style": "dash",
-  "img-req-src": false,
-  "img-req-alt": false,
-  "indent-style": "spaces",
-  "indent-width": 2,
-  "spec-char-escape": false,
-  "tag-bans": ["b", "i"],
-  "title-max-len": false
-}
diff --git a/build/htmllint.js b/build/htmllint.js
new file mode 100644 (file)
index 0000000..a40ff92
--- /dev/null
@@ -0,0 +1,23 @@
+'use strict'
+
+const childProcess = require('child_process')
+const fs = require('fs')
+
+if (fs.existsSync('vnu.jar')) {
+  childProcess.exec('java -version', function (error) {
+    if (error) {
+      console.error('skipping HTML lint test. java missing.')
+      return
+    }
+
+    const vnu = childProcess.spawn(
+                                   'java',
+                                   ['-jar', 'vnu.jar', '--skip-non-html', '_gh_pages/'],
+                                   { stdio: 'inherit' }
+                                  )
+
+    vnu.on('exit', process.exit)
+  })
+} else {
+  console.error('skipping HTML lint test. vnu.jar missing.')
+}
index 0b4958ff58ca65f154b327fcc1d682c46373c65a..c7ed1ae5a2cac0a2a871d48c3f90f73d04e2aba1 100644 (file)
@@ -49,7 +49,7 @@
     "docs-compile": "bundle exec jekyll build",
     "postdocs-compile": "npm run docs-workbox-precache",
     "docs-github": "shx echo \"github: true\" > twbsconfig.yml && npm run docs-compile -- --config _config.yml,twbsconfig.yml && shx rm ./twbsconfig.yml",
-    "docs-lint": "htmllint --rc build/.htmllintrc \"_gh_pages/**/*.html\" \"js/tests/**/*.html\"",
+    "docs-lint": "node build/htmllint.js",
     "docs-serve": "bundle exec jekyll serve",
     "docs-upload-preview": "build/upload-preview.sh",
     "docs-workbox-precache": "node build/workbox.js",