Remove unused task whitespace-check
diff --git a/Gruntfile.js b/Gruntfile.js
index a15588a..b99ade3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -38,8 +38,7 @@
grunt.loadTasks('tasks');
// defaults
- grunt.registerTask('default', ['build', 'test']);
- grunt.registerTask('build', ['compile', 'whitespace-check']);
+ grunt.registerTask('default', ['compile', 'test']);
grunt.registerTask('test', ['compile:test', '_test']);
grunt.registerTask('cover', ['compile', '_cover']);
};
diff --git a/tasks/lib/process-white-space.js b/tasks/lib/process-white-space.js
deleted file mode 100644
index 11fb316..0000000
--- a/tasks/lib/process-white-space.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF
- * or more contributor license agreements. See th
- * distributed with this work for additional infor
- * regarding copyright ownership. The ASF license
- * to you under the Apache License, Version 2.0 (t
- * "License"); you may not use this file except in
- * with the License. You may obtain a copy of the
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to
- * software distributed under the License is distr
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- * KIND, either express or implied. See the Licen
- * specific language governing permissions and lim
- * under the License.
- */
-
-var fs = require('fs');
-var path = require('path');
-
-// Iterates over a directory
-function forEachFile(root, cbFile, cbDone) {
- var count = 0;
-
- function scan(name) {
- ++count;
-
- fs.stat(name, function (err, stats) {
- if (err) cbFile(err);
-
- if (stats.isDirectory()) {
- fs.readdir(name, function (err, files) {
- if (err) cbFile(err);
-
- files.forEach(function (file) {
- scan(path.join(name, file));
- });
- done();
- });
- } else if (stats.isFile()) {
- cbFile(null, name, stats, done);
- } else {
- done();
- }
- });
- }
-
- function done() {
- --count;
- if (count === 0 && cbDone) cbDone();
- }
-
- scan(root);
-}
-
-module.exports = function processWhiteSpace(processor, callback) {
-
- var rexp_minified = new RegExp("\\.min\\.js$");
- var rexp_src = new RegExp('\\.js$');
-
- forEachFile('src', function(err, file, stats, cbDone) {
- //if (err) throw err;
- if (rexp_minified.test(file) || !rexp_src.test(file)) {
- cbDone();
- } else {
- var origsrc = src = fs.readFileSync(file, 'utf8');
-
- // tabs -> four spaces
- if (src.indexOf('\t') >= 0) {
- src = src.split('\t').join(' ');
- }
-
- // eliminate trailing white space
- src = src.replace(/ +\n/g, '\n');
-
- if (origsrc !== src) {
- // write it out yo
- processor(file, src);
- }
- cbDone();
- }
- }, callback);
-}
diff --git a/tasks/whitespace.js b/tasks/whitespace.js
deleted file mode 100644
index e5dfa89..0000000
--- a/tasks/whitespace.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-var processWhiteSpace = require('./lib/process-white-space');
-var fs = require('fs');
-
-module.exports = function(grunt) {
-
- grunt.registerTask('whitespace-check', 'Check for whitespace issues.', function() {
- var done = this.async();
- var complainedAboutWhitespace = false;
- processWhiteSpace(function(file, newSource) {
- if (!complainedAboutWhitespace) {
- grunt.log.writeln("files with whitespace issues: (to fix: `grunt whitespace-fix`)");
- complainedAboutWhitespace = true;
- }
- grunt.log.writeln(" " + file);
- }, done);
- });
-
- grunt.registerTask('whitespace-fix', 'Convert tabs to four spaces, eliminate trailing whitespace, convert newlines to proper form.', function() {
- var done = this.async();
- var complainedAboutWhitespace = false;
- processWhiteSpace(function(file, newSource) {
- if (!complainedAboutWhitespace) {
- grunt.log.writeln("Fixed whitespace issues in:");
- complainedAboutWhitespace = true;
- }
- fs.writeFileSync(file, newSource, 'utf8');
- grunt.log.writeln(" " + file);
- }, done);
- });
-}