diff options
author | Felix Nagel <info@felixnagel.com> | 2013-07-09 22:55:35 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-07-09 22:55:35 +0200 |
commit | 05832d6b6a1e313c172a903be54e98dd46fa2b5c (patch) | |
tree | caee34ff88b3af85c8bb9bf0f03b198c3f5e8f0c /build | |
parent | 009aa6a953ac0a7376baf0a7615e4c119ea59b23 (diff) | |
parent | afeaf565bb0b91c399603a0ddd82a925cabef6aa (diff) | |
download | jquery-ui-05832d6b6a1e313c172a903be54e98dd46fa2b5c.tar.gz jquery-ui-05832d6b6a1e313c172a903be54e98dd46fa2b5c.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'build')
-rw-r--r-- | build/tasks/build.js | 33 | ||||
-rw-r--r-- | build/tasks/testswarm.js | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js index 4d803df77..c50745899 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -135,4 +135,37 @@ grunt.registerTask( "clean", function() { require( "rimraf" ).sync( "dist" ); }); +grunt.registerTask( "asciilint", function() { + var valid = true, + files = grunt.file.expand({ filter: "isFile" }, "ui/*.js" ); + files.forEach(function( filename ) { + var i, c, + text = grunt.file.read( filename ); + + // Ensure files use only \n for line endings, not \r\n + if ( /\x0d\x0a/.test( text ) ) { + grunt.log.error( filename + ": Incorrect line endings (\\r\\n)" ); + valid = false; + } + + // Ensure only ASCII chars so script tags don't need a charset attribute + if ( text.length !== Buffer.byteLength( text, "utf8" ) ) { + grunt.log.error( filename + ": Non-ASCII characters detected:" ); + for ( i = 0; i < text.length; i++ ) { + c = text.charCodeAt( i ); + if ( c > 127 ) { + grunt.log.error( "- position " + i + ": " + c ); + grunt.log.error( "-- " + text.substring( i - 20, i + 20 ) ); + break; + } + } + valid = false; + } + }); + if ( valid ) { + grunt.log.ok( files.length + " files lint free." ); + } + return valid; +}); + }; diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 825b23b0c..16d213e4b 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -4,6 +4,7 @@ module.exports = function( grunt ) { var versions = { "git": "git", + "1.10": "1.10.0 1.10.1 1.10.2", "1.9": "1.9.0 1.9.1", "1.8": "1.8.0 1.8.1 1.8.2 1.8.3", "1.7": "1.7 1.7.1 1.7.2", |