[Pkg-javascript-commits] [less.js] 56/58: jscs style checking. Fixed whitespace issues.

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit 31c3d04980c94f7b34b4f97a0934a01d5664bb4e
Author: Luke Page <luke.a.page at gmail.com>
Date:   Mon Jan 26 23:34:35 2015 +0000

    jscs style checking. Fixed whitespace issues.
---
 .jscsrc                                          |   6 +
 .jshintrc                                        |   1 -
 Gruntfile.js                                     |  52 +-
 bin/lessc                                        | 714 ++++++++++++-----------
 lib/less-browser/add-default-options.js          |   6 +-
 lib/less-browser/bootstrap.js                    |  18 +-
 lib/less-browser/index.js                        |  28 +-
 lib/less-node/file-manager.js                    |   6 +-
 lib/less-node/image-size.js                      |  48 +-
 lib/less-node/lessc-helper.js                    |   4 +-
 lib/less-rhino/index.js                          |   2 -
 lib/less/contexts.js                             |   1 -
 lib/less/functions/data-uri.js                   |  28 +-
 lib/less/import-manager.js                       |   8 +-
 lib/less/parse-tree.js                           |  12 +-
 lib/less/parser/parser.js                        |  22 +-
 lib/less/tree/assignment.js                      |   1 -
 lib/less/tree/directive.js                       |   6 +-
 lib/less/tree/ruleset.js                         |   4 +-
 lib/less/visitors/extend-visitor.js              |   2 +-
 lib/less/visitors/import-sequencer.js            |  44 +-
 lib/less/visitors/import-visitor.js              |  20 +-
 package.json                                     |   1 +
 test/browser/common.js                           |   2 +-
 test/browser/jasmine-jsreporter.js               |   1 -
 test/browser/runner-errors-options.js            |   1 -
 test/browser/runner-errors-spec.js               |   1 -
 test/browser/runner-legacy-options.js            |   1 -
 test/browser/runner-no-js-errors-spec.js         |   1 -
 test/browser/runner-production-options.js        |   1 -
 test/browser/runner-relative-urls-options.js     |   1 -
 test/browser/runner-rootpath-options.js          |   1 -
 test/browser/runner-rootpath-relative-options.js |   1 -
 test/browser/runner-strict-units-options.js      |   1 -
 test/less-test.js                                |  71 ++-
 35 files changed, 559 insertions(+), 558 deletions(-)

diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000..c42a02e
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,6 @@
+{
+    "disallowImplicitTypeConversion": [/*"numeric", "boolean", "binary", "string"*/], /* should be true*/
+    "disallowMixedSpacesAndTabs": true,
+    "disallowMultipleLineBreaks": true,
+    "disallowTrailingWhitespace": true
+}
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
index 5c31e91..42606dc 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -5,7 +5,6 @@
     "node": true,
     "undef": true,
     "unused": "vars",
-    "trailing": true,
     "noarg": true,
     "eqnull": true,
     "forin": true,
diff --git a/Gruntfile.js b/Gruntfile.js
index 4c6bc17..b9dd670 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -5,8 +5,8 @@ module.exports = function (grunt) {
 
     // Report the elapsed execution time of tasks.
     require('time-grunt')(grunt);
-	
-	var COMPRESS_FOR_TESTS = true;
+
+    var COMPRESS_FOR_TESTS = true;
 
     // Project configuration.
     grunt.initConfig({
@@ -96,18 +96,18 @@ module.exports = function (grunt) {
             options: {
                 banner: '<%= meta.banner %>',
                 mangle: true,
-	            compress: {
-	                pure_getters: true
-	            }
+                compress: {
+                    pure_getters: true
+                }
             },
             dist: {
                 src: ['<%= concat.dist.dest %>'],
                 dest: 'dist/less.min.js'
             },
-	        test: {
-		        src: '<%= browserify.browser.dest %>',
-		        dest: 'tmp/less.min.js'
-	        }
+            test: {
+                src: '<%= browserify.browser.dest %>',
+                dest: 'tmp/less.min.js'
+            }
         },
 
         jshint: {
@@ -124,6 +124,13 @@ module.exports = function (grunt) {
             }
         },
 
+        jscs: {
+            src: ["test/**/*.js", "lib/less*/**/*.js", "bin/lessc"],
+            options: {
+                config: ".jscsrc"
+            }
+        },
+
         connect: {
             server: {
                 options: {
@@ -347,7 +354,7 @@ module.exports = function (grunt) {
     // Create the browser version of less.js
     grunt.registerTask('browsertest-lessjs', [
         'browserify:browser',
-	    'uglify:test',
+        'uglify:test',
         'concat:browsertest'
     ]);
 
@@ -365,19 +372,19 @@ module.exports = function (grunt) {
         'connect::keepalive'
     ]);
 
-	var previous_force_state = grunt.option("force");
+    var previous_force_state = grunt.option("force");
 
-	grunt.registerTask("force",function(set){
-		if (set === "on") {
-			grunt.option("force",true);
-		}
-		else if (set === "off") {
-			grunt.option("force",false);
-		}
-		else if (set === "restore") {
-			grunt.option("force",previous_force_state);
-		}
-	});
+    grunt.registerTask("force",function(set){
+        if (set === "on") {
+            grunt.option("force",true);
+        }
+        else if (set === "off") {
+            grunt.option("force",false);
+        }
+        else if (set === "restore") {
+            grunt.option("force",previous_force_state);
+        }
+    });
 
     grunt.registerTask('sauce', [
         'browsertest-lessjs',
@@ -395,6 +402,7 @@ module.exports = function (grunt) {
     var testTasks = [
         'clean',
         'jshint',
+        'jscs',
         'shell:test',
         'browsertest'
     ];
diff --git a/bin/lessc b/bin/lessc
index ca1cd94..46f6421 100755
--- a/bin/lessc
+++ b/bin/lessc
@@ -80,401 +80,403 @@ function printUsage() {
     continueProcessing = false;
 }
 
-args = args.filter(function (arg) {
-    var match;
-
-    match = arg.match(/^-I(.+)$/);
-    if (match) {
-        options.paths.push(match[1]);
-        return false;
-    }
+// self executing function so we can return
+(function() {
+    args = args.filter(function (arg) {
+        var match;
+
+        match = arg.match(/^-I(.+)$/);
+        if (match) {
+            options.paths.push(match[1]);
+            return false;
+        }
 
-    match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=(.*))?$/i);
-    if (match) { arg = match[1]; }
-    else { return arg; }
-
-    switch (arg) {
-        case 'v':
-        case 'version':
-            console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]");
-            continueProcessing = false;
-            break;
-        case 'verbose':
-            verbose = true;
-            break;
-        case 's':
-        case 'silent':
-            silent = true;
-            break;
-        case 'l':
-        case 'lint':
-            options.lint = true;
-            break;
-        case 'strict-imports':
-            options.strictImports = true;
-            break;
-        case 'h':
-        case 'help':
-            printUsage();
-            break;
-        case 'x':
-        case 'compress':
-            options.compress = true;
-            break;
-        case 'insecure':
-            options.insecure = true;
-            break;
-        case 'M':
-        case 'depends':
-            options.depends = true;
-            break;
-        case 'max-line-len':
-            if (checkArgFunc(arg, match[2])) {
-                options.maxLineLen = parseInt(match[2], 10);
-                if (options.maxLineLen <= 0) {
-                  options.maxLineLen = -1;
+        match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=(.*))?$/i);
+        if (match) { arg = match[1]; }
+        else { return arg; }
+
+        switch (arg) {
+            case 'v':
+            case 'version':
+                console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]");
+                continueProcessing = false;
+                break;
+            case 'verbose':
+                verbose = true;
+                break;
+            case 's':
+            case 'silent':
+                silent = true;
+                break;
+            case 'l':
+            case 'lint':
+                options.lint = true;
+                break;
+            case 'strict-imports':
+                options.strictImports = true;
+                break;
+            case 'h':
+            case 'help':
+                printUsage();
+                break;
+            case 'x':
+            case 'compress':
+                options.compress = true;
+                break;
+            case 'insecure':
+                options.insecure = true;
+                break;
+            case 'M':
+            case 'depends':
+                options.depends = true;
+                break;
+            case 'max-line-len':
+                if (checkArgFunc(arg, match[2])) {
+                    options.maxLineLen = parseInt(match[2], 10);
+                    if (options.maxLineLen <= 0) {
+                      options.maxLineLen = -1;
+                    }
                 }
-            }
-            break;
-        case 'no-color':
-            options.color = false;
-            break;
-        case 'no-ie-compat':
-            options.ieCompat = false;
-            break;
-        case 'no-js':
-            options.javascriptEnabled = false;
-            break;
-        case 'include-path':
-            if (checkArgFunc(arg, match[2])) {
-                options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
-                    .map(function(p) {
-                        if (p) {
-                            return path.resolve(process.cwd(), p);
-                        }
-                    });
-            }
-            break;
-        case 'line-numbers':
-            if (checkArgFunc(arg, match[2])) {
-                options.dumpLineNumbers = match[2];
-            }
-            break;
-        case 'source-map':
-            options.sourceMap = true;
-            if (match[2]) {
-                sourceMapOptions.sourceMapFullFilename = match[2];
-            }
-            break;
-        case 'source-map-rootpath':
-            if (checkArgFunc(arg, match[2])) {
-                sourceMapOptions.sourceMapRootpath = match[2];
-            }
-            break;
-        case 'source-map-basepath':
-            if (checkArgFunc(arg, match[2])) {
-                sourceMapOptions.sourceMapBasepath = match[2];
-            }
-            break;
-        case 'source-map-map-inline':
-            sourceMapFileInline = true;
-            options.sourceMap = true;
-            break;
-        case 'source-map-less-inline':
-            sourceMapOptions.outputSourceFiles = true;
-            break;
-        case 'source-map-url':
-            if (checkArgFunc(arg, match[2])) {
-                sourceMapOptions.sourceMapURL = match[2];
-            }
-            break;
-        case 'rp':
-        case 'rootpath':
-            if (checkArgFunc(arg, match[2])) {
-                options.rootpath = match[2].replace(/\\/g, '/');
-            }
-            break;
-        case "ru":
-        case "relative-urls":
-            options.relativeUrls = true;
-            break;
-        case "sm":
-        case "strict-math":
-            if (checkArgFunc(arg, match[2])) {
-                options.strictMath = checkBooleanArg(match[2]);
-            }
-            break;
-        case "su":
-        case "strict-units":
-            if (checkArgFunc(arg, match[2])) {
-                options.strictUnits = checkBooleanArg(match[2]);
-            }
-            break;
-        case "global-var":
-            if (checkArgFunc(arg, match[2])) {
-                if (!options.globalVars) {
-                    options.globalVars = {};
+                break;
+            case 'no-color':
+                options.color = false;
+                break;
+            case 'no-ie-compat':
+                options.ieCompat = false;
+                break;
+            case 'no-js':
+                options.javascriptEnabled = false;
+                break;
+            case 'include-path':
+                if (checkArgFunc(arg, match[2])) {
+                    options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
+                        .map(function(p) {
+                            if (p) {
+                                return path.resolve(process.cwd(), p);
+                            }
+                        });
                 }
-                parseVariableOption(match[2], options.globalVars);
-            }
-            break;
-        case "modify-var":
-            if (checkArgFunc(arg, match[2])) {
-                if (!options.modifyVars) {
-                    options.modifyVars = {};
+                break;
+            case 'line-numbers':
+                if (checkArgFunc(arg, match[2])) {
+                    options.dumpLineNumbers = match[2];
+                }
+                break;
+            case 'source-map':
+                options.sourceMap = true;
+                if (match[2]) {
+                    sourceMapOptions.sourceMapFullFilename = match[2];
+                }
+                break;
+            case 'source-map-rootpath':
+                if (checkArgFunc(arg, match[2])) {
+                    sourceMapOptions.sourceMapRootpath = match[2];
+                }
+                break;
+            case 'source-map-basepath':
+                if (checkArgFunc(arg, match[2])) {
+                    sourceMapOptions.sourceMapBasepath = match[2];
+                }
+                break;
+            case 'source-map-map-inline':
+                sourceMapFileInline = true;
+                options.sourceMap = true;
+                break;
+            case 'source-map-less-inline':
+                sourceMapOptions.outputSourceFiles = true;
+                break;
+            case 'source-map-url':
+                if (checkArgFunc(arg, match[2])) {
+                    sourceMapOptions.sourceMapURL = match[2];
+                }
+                break;
+            case 'rp':
+            case 'rootpath':
+                if (checkArgFunc(arg, match[2])) {
+                    options.rootpath = match[2].replace(/\\/g, '/');
+                }
+                break;
+            case "ru":
+            case "relative-urls":
+                options.relativeUrls = true;
+                break;
+            case "sm":
+            case "strict-math":
+                if (checkArgFunc(arg, match[2])) {
+                    options.strictMath = checkBooleanArg(match[2]);
+                }
+                break;
+            case "su":
+            case "strict-units":
+                if (checkArgFunc(arg, match[2])) {
+                    options.strictUnits = checkBooleanArg(match[2]);
+                }
+                break;
+            case "global-var":
+                if (checkArgFunc(arg, match[2])) {
+                    if (!options.globalVars) {
+                        options.globalVars = {};
+                    }
+                    parseVariableOption(match[2], options.globalVars);
+                }
+                break;
+            case "modify-var":
+                if (checkArgFunc(arg, match[2])) {
+                    if (!options.modifyVars) {
+                        options.modifyVars = {};
+                    }
+
+                    parseVariableOption(match[2], options.modifyVars);
+                }
+                break;
+            case 'url-args':
+                if (checkArgFunc(arg, match[2])) {
+                    options.urlArgs = match[2];
+                }
+                break;
+            case 'plugin':
+                var splitupArg = match[2].match(/^([^=]+)(=(.*))?/),
+                    name = splitupArg[1],
+                    pluginOptions = splitupArg[3];
+
+                plugin = pluginLoader.tryLoadPlugin(name, pluginOptions);
+                if (plugin) {
+                    plugins.push(plugin);
+                } else {
+                    console.log("Unable to load plugin " + name + " please make sure that it is installed under or at the same level as less");
+                    console.log();
+                    printUsage();
+                    currentErrorcode = 1;
+                }
+                break;
+            default:
+                plugin = pluginLoader.tryLoadPlugin("less-plugin-" + arg, match[2]);
+                if (plugin) {
+                    plugins.push(plugin);
+                } else {
+                    console.log("Unable to interpret argument " + arg + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at the same level as less");
+                    console.log();
+                    printUsage();
+                    currentErrorcode = 1;
                 }
+                break;
+        }
+    });
 
-                parseVariableOption(match[2], options.modifyVars);
-            }
-            break;
-        case 'url-args':
-            if (checkArgFunc(arg, match[2])) {
-                options.urlArgs = match[2];
-            }
-            break;
-        case 'plugin':
-            var splitupArg = match[2].match(/^([^=]+)(=(.*))?/),
-                name = splitupArg[1],
-                pluginOptions = splitupArg[3];
-
-            plugin = pluginLoader.tryLoadPlugin(name, pluginOptions);
-            if (plugin) {
-                plugins.push(plugin);
-            } else {
-                console.log("Unable to load plugin " + name + " please make sure that it is installed under or at the same level as less");
-                console.log();
-                printUsage();
-                currentErrorcode = 1;
-            }
-            break;
-        default:
-            plugin = pluginLoader.tryLoadPlugin("less-plugin-" + arg, match[2]);
-            if (plugin) {
-                plugins.push(plugin);
-            } else {
-                console.log("Unable to interpret argument " + arg + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at the same level as less");
-                console.log();
-                printUsage();
-                currentErrorcode = 1;
-            }
-            break;
+    if (!continueProcessing) {
+        return;
     }
-});
 
-if (!continueProcessing) {
-    return;
-}
-
-var input = args[1];
-if (input && input != '-') {
-    input = path.resolve(process.cwd(), input);
-}
-var output = args[2];
-var outputbase = args[2];
-if (output) {
-    output = path.resolve(process.cwd(), output);
-    if (warningMessages) {
-        console.log(warningMessages);
+    var input = args[1];
+    if (input && input != '-') {
+        input = path.resolve(process.cwd(), input);
     }
-}
-
-if (options.sourceMap) {
-
-    sourceMapOptions.sourceMapInputFilename = input;
-    if (!sourceMapOptions.sourceMapFullFilename) {
-        if (!output && !sourceMapFileInline) {
-            console.log("the sourcemap option only has an optional filename if the css filename is given");
-            console.log("consider adding --source-map-map-inline which embeds the sourcemap into the css");
-            return;
+    var output = args[2];
+    var outputbase = args[2];
+    if (output) {
+        output = path.resolve(process.cwd(), output);
+        if (warningMessages) {
+            console.log(warningMessages);
         }
-        // its in the same directory, so always just the basename
-        sourceMapOptions.sourceMapOutputFilename = path.basename(output);
-        sourceMapOptions.sourceMapFullFilename = output + ".map";
-        // its in the same directory, so always just the basename
-        sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename);
-    } else if (options.sourceMap && !sourceMapFileInline) {
-        var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename),
-            mapDir = path.dirname(mapFilename),
-            outputDir = path.dirname(output);
-        // find the path from the map to the output file
-        sourceMapOptions.sourceMapOutputFilename = path.join(
-            path.relative(mapDir, outputDir), path.basename(output));
-
-        // make the sourcemap filename point to the sourcemap relative to the css file output directory
-        sourceMapOptions.sourceMapFilename = path.join(
-            path.relative(outputDir, mapDir), path.basename(sourceMapOptions.sourceMapFullFilename));
     }
-}
-
-if (sourceMapOptions.sourceMapBasepath === undefined) {
-    sourceMapOptions.sourceMapBasepath = input ? path.dirname(input) : process.cwd();
-}
 
-if (sourceMapOptions.sourceMapRootpath === undefined) {
-    var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename),
-        pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename);
-    sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);
-}
+    if (options.sourceMap) {
 
+        sourceMapOptions.sourceMapInputFilename = input;
+        if (!sourceMapOptions.sourceMapFullFilename) {
+            if (!output && !sourceMapFileInline) {
+                console.log("the sourcemap option only has an optional filename if the css filename is given");
+                console.log("consider adding --source-map-map-inline which embeds the sourcemap into the css");
+                return;
+            }
+            // its in the same directory, so always just the basename
+            sourceMapOptions.sourceMapOutputFilename = path.basename(output);
+            sourceMapOptions.sourceMapFullFilename = output + ".map";
+            // its in the same directory, so always just the basename
+            sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename);
+        } else if (options.sourceMap && !sourceMapFileInline) {
+            var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename),
+                mapDir = path.dirname(mapFilename),
+                outputDir = path.dirname(output);
+            // find the path from the map to the output file
+            sourceMapOptions.sourceMapOutputFilename = path.join(
+                path.relative(mapDir, outputDir), path.basename(output));
+
+            // make the sourcemap filename point to the sourcemap relative to the css file output directory
+            sourceMapOptions.sourceMapFilename = path.join(
+                path.relative(outputDir, mapDir), path.basename(sourceMapOptions.sourceMapFullFilename));
+        }
+    }
 
-if (! input) {
-    console.log("lessc: no input files");
-    console.log("");
-    printUsage();
-    currentErrorcode = 1;
-    return;
-}
+    if (sourceMapOptions.sourceMapBasepath === undefined) {
+        sourceMapOptions.sourceMapBasepath = input ? path.dirname(input) : process.cwd();
+    }
 
-var ensureDirectory = function (filepath) {
-    var dir = path.dirname(filepath),
-        cmd,
-        existsSync = fs.existsSync || path.existsSync;
-    if (!existsSync(dir)) {
-        if (mkdirp === undefined) {
-            try {mkdirp = require('mkdirp');}
-            catch(e) { mkdirp = null; }
-        }
-        cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
-        cmd(dir);
+    if (sourceMapOptions.sourceMapRootpath === undefined) {
+        var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename),
+            pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename);
+        sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);
     }
-};
 
-if (options.depends) {
-    if (!outputbase) {
-        console.log("option --depends requires an output path to be specified");
+    if (! input) {
+        console.log("lessc: no input files");
+        console.log("");
+        printUsage();
+        currentErrorcode = 1;
         return;
     }
-    process.stdout.write(outputbase + ": ");
-}
 
-if (!sourceMapFileInline) {
-    var writeSourceMap = function(output, onDone) {
-        var filename = sourceMapOptions.sourceMapFullFilename;
-        ensureDirectory(filename);
-        fs.writeFile(filename, output, 'utf8', function (err) {
-            if (err) {
-                var description = "Error: ";
-                if (errno && errno.errno[err.errno]) {
-                    description += errno.errno[err.errno].description;
-                } else {
-                    description += err.code + " " + err.message;
-                }
-                less.logger.error('lessc: failed to create file ' + filename);
-                less.logger.error(description);
-            } else {
-                less.logger.info('lessc: wrote ' + filename);
+    var ensureDirectory = function (filepath) {
+        var dir = path.dirname(filepath),
+            cmd,
+            existsSync = fs.existsSync || path.existsSync;
+        if (!existsSync(dir)) {
+            if (mkdirp === undefined) {
+                try {mkdirp = require('mkdirp');}
+                catch(e) { mkdirp = null; }
             }
-            onDone();
-        });
+            cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
+            cmd(dir);
+        }
     };
-}
 
-var writeSourceMapIfNeeded = function(output, onDone) {
-    if (options.sourceMap && !sourceMapFileInline) {
-        writeSourceMap(output, onDone);
+    if (options.depends) {
+        if (!outputbase) {
+            console.log("option --depends requires an output path to be specified");
+            return;
+        }
+        process.stdout.write(outputbase + ": ");
     }
-};
 
-var writeOutput = function(output, result, onSuccess) {
-    if (output) {
-        ensureDirectory(output);
-        fs.writeFile(output, result.css, {encoding: 'utf8'}, function (err) {
-            if (err) {
-                var description = "Error: ";
-                if (errno && errno.errno[err.errno]) {
-                    description += errno.errno[err.errno].description;
+    if (!sourceMapFileInline) {
+        var writeSourceMap = function(output, onDone) {
+            var filename = sourceMapOptions.sourceMapFullFilename;
+            ensureDirectory(filename);
+            fs.writeFile(filename, output, 'utf8', function (err) {
+                if (err) {
+                    var description = "Error: ";
+                    if (errno && errno.errno[err.errno]) {
+                        description += errno.errno[err.errno].description;
+                    } else {
+                        description += err.code + " " + err.message;
+                    }
+                    less.logger.error('lessc: failed to create file ' + filename);
+                    less.logger.error(description);
                 } else {
-                    description += err.code + " " + err.message;
+                    less.logger.info('lessc: wrote ' + filename);
                 }
-                less.logger.error('lessc: failed to create file ' + output);
-                less.logger.error(description);
-            } else {
-                less.logger.info('lessc: wrote ' + output);
-                onSuccess();
-            }
-        });
-    } else if (!options.depends) {
-        process.stdout.write(result.css);
-        onSuccess();
+                onDone();
+            });
+        };
     }
-};
 
-var logDependencies = function(options, result) {
-    if (options.depends) {
-        var depends = "";
-        for(var i = 0; i < result.imports.length; i++) {
-            depends += result.imports[i] + " ";
+    var writeSourceMapIfNeeded = function(output, onDone) {
+        if (options.sourceMap && !sourceMapFileInline) {
+            writeSourceMap(output, onDone);
         }
-        console.log(depends);
-    }
-};
+    };
 
-var parseLessFile = function (e, data) {
-    if (e) {
-        console.log("lessc: " + e.message);
-        currentErrorcode = 1;
-        return;
-    }
+    var writeOutput = function(output, result, onSuccess) {
+        if (output) {
+            ensureDirectory(output);
+            fs.writeFile(output, result.css, {encoding: 'utf8'}, function (err) {
+                if (err) {
+                    var description = "Error: ";
+                    if (errno && errno.errno[err.errno]) {
+                        description += errno.errno[err.errno].description;
+                    } else {
+                        description += err.code + " " + err.message;
+                    }
+                    less.logger.error('lessc: failed to create file ' + output);
+                    less.logger.error(description);
+                } else {
+                    less.logger.info('lessc: wrote ' + output);
+                    onSuccess();
+                }
+            });
+        } else if (!options.depends) {
+            process.stdout.write(result.css);
+            onSuccess();
+        }
+    };
+
+    var logDependencies = function(options, result) {
+        if (options.depends) {
+            var depends = "";
+            for(var i = 0; i < result.imports.length; i++) {
+                depends += result.imports[i] + " ";
+            }
+            console.log(depends);
+        }
+    };
 
-    data = data.replace(/^\uFEFF/, '');
+    var parseLessFile = function (e, data) {
+        if (e) {
+            console.log("lessc: " + e.message);
+            currentErrorcode = 1;
+            return;
+        }
 
-    options.paths = [path.dirname(input)].concat(options.paths);
-    options.filename = input;
+        data = data.replace(/^\uFEFF/, '');
 
-    if (options.lint) {
-        options.sourceMap = false;
-    }
-    sourceMapOptions.sourceMapFileInline = sourceMapFileInline;
+        options.paths = [path.dirname(input)].concat(options.paths);
+        options.filename = input;
 
-    if (options.sourceMap) {
-        options.sourceMap = sourceMapOptions;
-    }
+        if (options.lint) {
+            options.sourceMap = false;
+        }
+        sourceMapOptions.sourceMapFileInline = sourceMapFileInline;
 
-    less.logger.addListener({
-        info: function(msg) {
-            if (verbose) {
-                console.log(msg);
-            }
-        },
-        warn: function(msg) {
-            // do not show warning if outputting css to the console or the silent option is used
-            if (!silent && output) {
-                console.warn(msg);
-            }
-        },
-        error: function(msg) {
-            console.log(msg);
+        if (options.sourceMap) {
+            options.sourceMap = sourceMapOptions;
         }
-    });
 
-    less.render(data, options)
-        .then(function(result) {
-            if(!options.lint) {
-                writeOutput(output, result, function() {
-                    writeSourceMapIfNeeded(result.map, function() {
-                        logDependencies(options, result);
-                    });
-                });
+        less.logger.addListener({
+            info: function(msg) {
+                if (verbose) {
+                    console.log(msg);
+                }
+            },
+            warn: function(msg) {
+                // do not show warning if outputting css to the console or the silent option is used
+                if (!silent && output) {
+                    console.warn(msg);
+                }
+            },
+            error: function(msg) {
+                console.log(msg);
             }
-        },
-        function(err) {
-            less.writeError(err, options);
-            currentErrorcode = 1;
         });
-};
 
-if (input != '-') {
-    fs.readFile(input, 'utf8', parseLessFile);
-} else {
-    process.stdin.resume();
-    process.stdin.setEncoding('utf8');
+        less.render(data, options)
+            .then(function(result) {
+                if(!options.lint) {
+                    writeOutput(output, result, function() {
+                        writeSourceMapIfNeeded(result.map, function() {
+                            logDependencies(options, result);
+                        });
+                    });
+                }
+            },
+            function(err) {
+                less.writeError(err, options);
+                currentErrorcode = 1;
+            });
+    };
 
-    var buffer = '';
-    process.stdin.on('data', function(data) {
-        buffer += data;
-    });
+    if (input != '-') {
+        fs.readFile(input, 'utf8', parseLessFile);
+    } else {
+        process.stdin.resume();
+        process.stdin.setEncoding('utf8');
 
-    process.stdin.on('end', function() {
-        parseLessFile(false, buffer);
-    });
-}
+        var buffer = '';
+        process.stdin.on('data', function(data) {
+            buffer += data;
+        });
+
+        process.stdin.on('end', function() {
+            parseLessFile(false, buffer);
+        });
+    }
+})();
\ No newline at end of file
diff --git a/lib/less-browser/add-default-options.js b/lib/less-browser/add-default-options.js
index 9742fe4..b06c58f 100644
--- a/lib/less-browser/add-default-options.js
+++ b/lib/less-browser/add-default-options.js
@@ -39,8 +39,8 @@ module.exports = function(window, options) {
         options.useFileCache = true;
     }
 
-	if (options.onReady === undefined) {
-		options.onReady = true;
-	}
+    if (options.onReady === undefined) {
+        options.onReady = true;
+    }
 
 };
diff --git a/lib/less-browser/bootstrap.js b/lib/less-browser/bootstrap.js
index 642214c..706f98b 100644
--- a/lib/less-browser/bootstrap.js
+++ b/lib/less-browser/bootstrap.js
@@ -14,13 +14,13 @@ require("./add-default-options")(window, options);
 var less = module.exports = require("./index")(window, options);
 
 if (options.onReady) {
-	if (/!watch/.test(window.location.hash)) {
-		less.watch();
-	}
-	
-	less.pageLoadFinished = less.registerStylesheets().then(
-		function () {
-			return less.refresh(less.env === 'development');
-		}
-	);
+    if (/!watch/.test(window.location.hash)) {
+        less.watch();
+    }
+
+    less.pageLoadFinished = less.registerStylesheets().then(
+        function () {
+            return less.refresh(less.env === 'development');
+        }
+    );
 }
\ No newline at end of file
diff --git a/lib/less-browser/index.js b/lib/less-browser/index.js
index 3708f53..7455b48 100644
--- a/lib/less-browser/index.js
+++ b/lib/less-browser/index.js
@@ -112,14 +112,14 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
         if (webInfo) {
             webInfo.remaining = remaining;
 
-	        if (!instanceOptions.modifyVars) {
-	            var css = cache.getCSS(path, webInfo);
-	            if (!reload && css) {
-	                webInfo.local = true;
-	                callback(null, css, data, sheet, webInfo, path);
-	                return;
-	            }
-	        }
+            if (!instanceOptions.modifyVars) {
+                var css = cache.getCSS(path, webInfo);
+                if (!reload && css) {
+                    webInfo.local = true;
+                    callback(null, css, data, sheet, webInfo, path);
+                    return;
+                }
+            }
         }
 
         //TODO add tests around how this behaves when reloading
@@ -131,11 +131,11 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
                 e.href = path;
                 callback(e);
             } else {
-	            result.css = postProcessCSS(result.css);
-	            if (!instanceOptions.modifyVars) {
-	                cache.setCSS(sheet.href, webInfo.lastModified, result.css);
-	            }
-	            callback(null, result.css, data, sheet, webInfo, path);
+                result.css = postProcessCSS(result.css);
+                if (!instanceOptions.modifyVars) {
+                    cache.setCSS(sheet.href, webInfo.lastModified, result.css);
+                }
+                callback(null, result.css, data, sheet, webInfo, path);
             }
         });
     }
@@ -232,7 +232,7 @@ less.refresh = function (reload, modifyVars, clearFileCache) {
             } else {
                 less.logger.info("rendered " + sheet.href + " successfully.");
             }
-	        browser.createCSS(window.document, css, sheet);
+            browser.createCSS(window.document, css, sheet);
             less.logger.info("css for " + sheet.href + " generated in " + (new Date() - endTime) + 'ms');
             if (webInfo.remaining === 0) {
                 totalMilliseconds = new Date() - startTime;
diff --git a/lib/less-node/file-manager.js b/lib/less-node/file-manager.js
index 4680250..7609289 100644
--- a/lib/less-node/file-manager.js
+++ b/lib/less-node/file-manager.js
@@ -39,10 +39,10 @@ FileManager.prototype.loadFile = function(filename, currentDirectory, options, e
     return new PromiseConstructor(function(fulfill, reject) {
         (function tryPathIndex(i) {
             if (i < paths.length) {
-	            fullFilename = filename;
-	            if (paths[i]) {
+                fullFilename = filename;
+                if (paths[i]) {
                     fullFilename = path.join(paths[i], fullFilename);
-	            }
+                }
                 fs.stat(fullFilename, function (err) {
                     if (err) {
                         filenamesTried.push(fullFilename);
diff --git a/lib/less-node/image-size.js b/lib/less-node/image-size.js
index eb11835..492153e 100644
--- a/lib/less-node/image-size.js
+++ b/lib/less-node/image-size.js
@@ -1,34 +1,34 @@
 var Dimension = require("../less/tree/dimension"),
-	Expression = require("../less/tree/expression"),
-	functionRegistry = require("./../less/functions/function-registry"),
-	path = require("path");
+    Expression = require("../less/tree/expression"),
+    functionRegistry = require("./../less/functions/function-registry"),
+    path = require("path");
 
 function imageSize(filePathNode) {
-	var filePath = filePathNode.value;
-	var currentDirectory = filePathNode.currentFileInfo.relativeUrls ?
-		filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath;
+    var filePath = filePathNode.value;
+    var currentDirectory = filePathNode.currentFileInfo.relativeUrls ?
+        filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath;
 
-	var sizeOf = require('image-size');
-	filePath = path.join(currentDirectory, filePath);
-	return sizeOf(filePath);
+    var sizeOf = require('image-size');
+    filePath = path.join(currentDirectory, filePath);
+    return sizeOf(filePath);
 }
 
 var imageFunctions = {
-	"image-size": function(filePathNode) {
-		var size = imageSize(filePathNode);
-		return new Expression([
-			new Dimension(size.width, "px"),
-			new Dimension(size.height, "px")
-		]);
-	},
-	"image-width": function(filePathNode) {
-		var size = imageSize(filePathNode);
-		return new Dimension(size.width, "px");
-	},
-	"image-height": function(filePathNode) {
-		var size = imageSize(filePathNode);
-		return new Dimension(size.height, "px");
-	}
+    "image-size": function(filePathNode) {
+        var size = imageSize(filePathNode);
+        return new Expression([
+            new Dimension(size.width, "px"),
+            new Dimension(size.height, "px")
+        ]);
+    },
+    "image-width": function(filePathNode) {
+        var size = imageSize(filePathNode);
+        return new Dimension(size.width, "px");
+    },
+    "image-height": function(filePathNode) {
+        var size = imageSize(filePathNode);
+        return new Dimension(size.height, "px");
+    }
 };
 
 functionRegistry.addMultiple(imageFunctions);
\ No newline at end of file
diff --git a/lib/less-node/lessc-helper.js b/lib/less-node/lessc-helper.js
index 4e24800..30f17c4 100644
--- a/lib/less-node/lessc-helper.js
+++ b/lib/less-node/lessc-helper.js
@@ -70,8 +70,8 @@ var lessc_helper = {
         console.log("                           media query which is compatible with the SASS");
         console.log("                           format, and 'all' which will do both.");
         console.log("  --verbose                Be verbose.");
-	    console.log("  -x, --compress           Compresses output by removing some whitespaces.");
-	    console.log("                           We recommend you use a dedicated minifer like less-plugin-clean-css");
+        console.log("  -x, --compress           Compresses output by removing some whitespaces.");
+        console.log("                           We recommend you use a dedicated minifer like less-plugin-clean-css");
         console.log("");
         console.log("Report bugs to: http://github.com/less/less.js/issues");
         console.log("Home page: <http://lesscss.org/>");
diff --git a/lib/less-rhino/index.js b/lib/less-rhino/index.js
index d626b17..adf2de8 100644
--- a/lib/less-rhino/index.js
+++ b/lib/less-rhino/index.js
@@ -135,7 +135,6 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) {
     }
 };
 
-
 function writeFile(filename, content) {
     var fstream = new java.io.FileWriter(filename);
     var out = new java.io.BufferedWriter(fstream);
@@ -371,7 +370,6 @@ function writeFile(filename, content) {
         options.sourceMapOutputFilename = options.sourceMap;
     }
 
-
     if (!name) {
         console.log("lessc: no inout files");
         console.log("");
diff --git a/lib/less/contexts.js b/lib/less/contexts.js
index 52b902e..d031b64 100644
--- a/lib/less/contexts.js
+++ b/lib/less/contexts.js
@@ -108,4 +108,3 @@ contexts.Eval.prototype.normalizePath = function( path ) {
 };
 
 //todo - do the same for the toCSS ?
-
diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js
index 35d9c56..ce8e50d 100644
--- a/lib/less/functions/data-uri.js
+++ b/lib/less/functions/data-uri.js
@@ -16,7 +16,7 @@ module.exports = function(environment) {
 
         var mimetype = mimetypeNode && mimetypeNode.value;
         var filePath = filePathNode.value;
-	    var currentFileInfo = this.currentFileInfo;
+        var currentFileInfo = this.currentFileInfo;
         var currentDirectory = currentFileInfo.relativeUrls ?
             currentFileInfo.currentDirectory : currentFileInfo.entryPath;
 
@@ -40,7 +40,7 @@ module.exports = function(environment) {
 
             mimetype = environment.mimeLookup(filePath);
 
-			if (mimetype === "image/svg+xml") {
+            if (mimetype === "image/svg+xml") {
                 useBase64 = false;
             } else {
                 // use base 64 unless it's an ASCII or UTF-8 format
@@ -59,25 +59,25 @@ module.exports = function(environment) {
             return fallback(this, filePathNode || mimetypeNode);
         }
         var buf = fileSync.contents;
-		if (useBase64 && !environment.encodeBase64) {
-			return fallback(this, filePathNode);
-		}
+        if (useBase64 && !environment.encodeBase64) {
+            return fallback(this, filePathNode);
+        }
 
         buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
 
         var uri = "data:" + mimetype + ',' + buf + fragment;
 
-		// IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded
-		// and the --ieCompat flag is enabled, return a normal url() instead.
-		var DATA_URI_MAX = 32768;
-		if (uri.length >= DATA_URI_MAX) {
+        // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded
+        // and the --ieCompat flag is enabled, return a normal url() instead.
+        var DATA_URI_MAX = 32768;
+        if (uri.length >= DATA_URI_MAX) {
 
-			if (this.context.ieCompat !== false) {
-				logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!");
+            if (this.context.ieCompat !== false) {
+                logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!");
 
-				return fallback(this, filePathNode || mimetypeNode);
-			}
-		}
+                return fallback(this, filePathNode || mimetypeNode);
+            }
+        }
 
         return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
     });
diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js
index 386320a..79ac50e 100644
--- a/lib/less/import-manager.js
+++ b/lib/less/import-manager.js
@@ -41,13 +41,13 @@ module.exports = function(environment) {
 
             var importedEqualsRoot = fullPath === importManager.rootFilename;
             if (importOptions.optional && e) {
-			callback(null, {rules:[]}, false, null);		
-			}
-			else {
+            callback(null, {rules:[]}, false, null);
+            }
+            else {
             importManager.files[fullPath] = root;
             if (e && !importManager.error) { importManager.error = e; }
             callback(e, root, importedEqualsRoot, fullPath);
-			}
+            }
         };
 
         var newFileInfo = {
diff --git a/lib/less/parse-tree.js b/lib/less/parse-tree.js
index 73b49b1..93045e0 100644
--- a/lib/less/parse-tree.js
+++ b/lib/less/parse-tree.js
@@ -1,6 +1,6 @@
 var LessError = require('./less-error'),
     transformTree = require("./transform-tree"),
-	logger = require("./logger");
+    logger = require("./logger");
 
 module.exports = function(SourceMapBuilder) {
 var ParseTree = function(root, imports) {
@@ -17,11 +17,11 @@ ParseTree.prototype.toCSS = function(options) {
     }
 
     try {
-	    var compress = Boolean(options.compress);
-	    if (compress) {
-		    logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");
-	    }
-	    
+        var compress = Boolean(options.compress);
+        if (compress) {
+            logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");
+        }
+
         var toCSSOptions = {
             compress: compress,
             dumpLineNumbers: options.dumpLineNumbers,
diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js
index 60c414d..2273869 100644
--- a/lib/less/parser/parser.js
+++ b/lib/less/parser/parser.js
@@ -238,10 +238,10 @@ var Parser = function Parser(context, imports, fileInfo) {
                         if (!node) { break; }
                         root.push(node);
                     }
-	                // always process comments before deciding if finished
-	                if (parserInput.finished) {
-		                break;
-	                }
+                    // always process comments before deciding if finished
+                    if (parserInput.finished) {
+                        break;
+                    }
                     if (parserInput.peek('}')) {
                         break;
                     }
@@ -1387,19 +1387,19 @@ var Parser = function Parser(context, imports, fileInfo) {
             sub: function () {
                 var a, e;
 
-	            parserInput.save();
+                parserInput.save();
                 if (parserInput.$char('(')) {
                     a = this.addition();
                     if (a && parserInput.$char(')')) {
-	                    parserInput.forget();
-	                    e = new(tree.Expression)([a]);
-	                    e.parens = true;
+                        parserInput.forget();
+                        e = new(tree.Expression)([a]);
+                        e.parens = true;
                         return e;
                     }
-	                parserInput.restore("Expected ')'");
-	                return;
+                    parserInput.restore("Expected ')'");
+                    return;
                 }
-	            parserInput.restore();
+                parserInput.restore();
             },
             multiplication: function () {
                 var m, a, op, operation, isSpaced;
diff --git a/lib/less/tree/assignment.js b/lib/less/tree/assignment.js
index ec91263..9c38879 100644
--- a/lib/less/tree/assignment.js
+++ b/lib/less/tree/assignment.js
@@ -25,4 +25,3 @@ Assignment.prototype.genCSS = function (context, output) {
     }
 };
 module.exports = Assignment;
-
diff --git a/lib/less/tree/directive.js b/lib/less/tree/directive.js
index 12165c5..20c0eb3 100644
--- a/lib/less/tree/directive.js
+++ b/lib/less/tree/directive.js
@@ -39,9 +39,9 @@ Directive.prototype.genCSS = function (context, output) {
         value.genCSS(context, output);
     }
     if (rules) {
-	    if (rules.type === "Ruleset") {
-		    rules = [rules];
-	    }
+        if (rules.type === "Ruleset") {
+            rules = [rules];
+        }
         this.outputRuleset(context, output, rules);
     } else {
         output.add(';');
diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js
index 39198d6..cd63e85 100644
--- a/lib/less/tree/ruleset.js
+++ b/lib/less/tree/ruleset.js
@@ -220,7 +220,7 @@ Ruleset.prototype.variables = function () {
             }
             // when evaluating variables in an import statement, imports have not been eval'd
             // so we need to go inside import statements.
-	        // guard against root being a string (in the case of inlined less)
+            // guard against root being a string (in the case of inlined less)
             if (r.type === "Import" && r.root && r.root.variables) {
                 var vars = r.root.variables();
                 for(var name in vars) {
@@ -451,12 +451,12 @@ Ruleset.prototype.getIsReferenced = function() {
     return false;
 };
 
-
 Ruleset.prototype.joinSelectors = function (paths, context, selectors) {
     for (var s = 0; s < selectors.length; s++) {
         this.joinSelector(paths, context, selectors[s]);
     }
 };
+
 Ruleset.prototype.joinSelector = function (paths, context, selector) {
 
     var i, j, k,
diff --git a/lib/less/visitors/extend-visitor.js b/lib/less/visitors/extend-visitor.js
index 2aaba72..5df87df 100644
--- a/lib/less/visitors/extend-visitor.js
+++ b/lib/less/visitors/extend-visitor.js
@@ -116,7 +116,7 @@ ProcessExtendsVisitor.prototype = {
 
                 if(!indicies[extend.index + ' ' + selector]) {
                     indicies[extend.index + ' ' + selector] = true;
-                    logger.warn("extend '"+selector+"' has no matches");   
+                    logger.warn("extend '"+selector+"' has no matches");
                 }
             });
     },
diff --git a/lib/less/visitors/import-sequencer.js b/lib/less/visitors/import-sequencer.js
index b9e27e9..b3e1fcf 100644
--- a/lib/less/visitors/import-sequencer.js
+++ b/lib/less/visitors/import-sequencer.js
@@ -2,7 +2,7 @@ function ImportSequencer(onSequencerEmpty) {
     this.imports = [];
     this.variableImports = [];
     this._onSequencerEmpty = onSequencerEmpty;
-	this._currentDepth = 0;
+    this._currentDepth = 0;
 }
 
 ImportSequencer.prototype.addImport = function(callback) {
@@ -25,27 +25,27 @@ ImportSequencer.prototype.addVariableImport = function(callback) {
 };
 
 ImportSequencer.prototype.tryRun = function() {
-	this._currentDepth++;
-	try {
-	    while(true) {
-	        while(this.imports.length > 0) {
-	            var importItem = this.imports[0];
-	            if (!importItem.isReady) {
-	                return;
-	            }
-	            this.imports = this.imports.slice(1);
-	            importItem.callback.apply(null, importItem.args);
-	        }
-	        if (this.variableImports.length === 0) {
-	            break;
-	        }
-	        var variableImport = this.variableImports[0];
-	        this.variableImports = this.variableImports.slice(1);
-	        variableImport();
-	    }
-	} finally {
-		this._currentDepth--;
-	}
+    this._currentDepth++;
+    try {
+        while(true) {
+            while(this.imports.length > 0) {
+                var importItem = this.imports[0];
+                if (!importItem.isReady) {
+                    return;
+                }
+                this.imports = this.imports.slice(1);
+                importItem.callback.apply(null, importItem.args);
+            }
+            if (this.variableImports.length === 0) {
+                break;
+            }
+            var variableImport = this.variableImports[0];
+            this.variableImports = this.variableImports.slice(1);
+            variableImport();
+        }
+    } finally {
+        this._currentDepth--;
+    }
     if (this._currentDepth === 0 && this._onSequencerEmpty) {
         this._onSequencerEmpty();
     }
diff --git a/lib/less/visitors/import-visitor.js b/lib/less/visitors/import-visitor.js
index f7e3070..e9faf91 100644
--- a/lib/less/visitors/import-visitor.js
+++ b/lib/less/visitors/import-visitor.js
@@ -28,12 +28,12 @@ ImportVisitor.prototype = {
         this.isFinished = true;
         this._sequencer.tryRun();
     },
-	_onSequencerEmpty: function() {
-		if (!this.isFinished) {
-			return;
-		}
-		this._finish(this.error);
-	},
+    _onSequencerEmpty: function() {
+        if (!this.isFinished) {
+            return;
+        }
+        this._finish(this.error);
+    },
     visitImport: function (importNode, visitArgs) {
         var inlineCSS = importNode.options.inline;
 
@@ -87,9 +87,9 @@ ImportVisitor.prototype = {
             this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.currentFileInfo, evaldImportNode.options, sequencedOnImported);
         } else {
             this.importCount--;
-	        if (this.isFinished) {
-		        this._sequencer.tryRun();
-	        }
+            if (this.isFinished) {
+                this._sequencer.tryRun();
+            }
         }
     },
     onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {
@@ -139,7 +139,7 @@ ImportVisitor.prototype = {
         importVisitor.importCount--;
 
         if (importVisitor.isFinished) {
-	        importVisitor._sequencer.tryRun();
+            importVisitor._sequencer.tryRun();
         }
     },
     visitRule: function (ruleNode, visitArgs) {
diff --git a/package.json b/package.json
index 763dfed..bfc44da 100644
--- a/package.json
+++ b/package.json
@@ -58,6 +58,7 @@
     "grunt-contrib-jasmine": "^0.8.1",
     "grunt-contrib-jshint": "^0.10.0",
     "grunt-contrib-uglify": "^0.7.0",
+	"grunt-jscs": "^1.2.0",
     "grunt-shell": "^1.1.1",
     "grunt-browserify": "^3.2.0",
     "matchdep": "^0.3.0",
diff --git a/test/browser/common.js b/test/browser/common.js
index 5b6772d..9e89a76 100644
--- a/test/browser/common.js
+++ b/test/browser/common.js
@@ -149,7 +149,7 @@ var testErrorSheet = function (sheet) {
                             .replace(/\{pathrel\}/g, "")
                             .replace(/\{pathhref\}/g, "http://localhost:8081/test/less/errors/")
                             .replace(/\{404status\}/g, " (404)")
-	                        .replace(/\{node\}.*\{\/node\}/g, "")
+                            .replace(/\{node\}.*\{\/node\}/g, "")
                             .replace(/\n$/, "");
                         expect(actualErrorMsg).toEqual(errorTxt);
                         if (errorTxt == actualErrorMsg) {
diff --git a/test/browser/jasmine-jsreporter.js b/test/browser/jasmine-jsreporter.js
index 4755317..4fd5569 100644
--- a/test/browser/jasmine-jsreporter.js
+++ b/test/browser/jasmine-jsreporter.js
@@ -180,7 +180,6 @@
     // export public
     jasmine.JSReporter = JSReporter;
 
-
     // ------------------------------------------------------------------------
     // Jasmine JSReporter for Jasmine 2.0
     // ------------------------------------------------------------------------
diff --git a/test/browser/runner-errors-options.js b/test/browser/runner-errors-options.js
index 1ed092e..8ba00e2 100644
--- a/test/browser/runner-errors-options.js
+++ b/test/browser/runner-errors-options.js
@@ -2,4 +2,3 @@ var less = {
     strictUnits: true,
     strictMath: true,
     logLevel: 4 };
-
diff --git a/test/browser/runner-errors-spec.js b/test/browser/runner-errors-spec.js
index 0b72067..8f59c59 100644
--- a/test/browser/runner-errors-spec.js
+++ b/test/browser/runner-errors-spec.js
@@ -1,4 +1,3 @@
 describe("less.js error tests", function() {
   testLessErrorsInDocument();
 });
-
diff --git a/test/browser/runner-legacy-options.js b/test/browser/runner-legacy-options.js
index eb53e35..ed93fbd 100644
--- a/test/browser/runner-legacy-options.js
+++ b/test/browser/runner-legacy-options.js
@@ -3,4 +3,3 @@ var less = {
     errorReporting: "console",
     strictMath: false,
     strictUnits: false };
-
diff --git a/test/browser/runner-no-js-errors-spec.js b/test/browser/runner-no-js-errors-spec.js
index 6c0e084..6ee7611 100644
--- a/test/browser/runner-no-js-errors-spec.js
+++ b/test/browser/runner-no-js-errors-spec.js
@@ -1,4 +1,3 @@
 describe("less.js javascript disabled error tests", function() {
     testLessErrorsInDocument();
 });
-
diff --git a/test/browser/runner-production-options.js b/test/browser/runner-production-options.js
index 2737aba..c93773f 100644
--- a/test/browser/runner-production-options.js
+++ b/test/browser/runner-production-options.js
@@ -1,4 +1,3 @@
 var less = {logLevel: 4,
     errorReporting: "console"};
 less.env = "production";
-
diff --git a/test/browser/runner-relative-urls-options.js b/test/browser/runner-relative-urls-options.js
index 3dcbad1..e5ebfd2 100644
--- a/test/browser/runner-relative-urls-options.js
+++ b/test/browser/runner-relative-urls-options.js
@@ -1,4 +1,3 @@
 var less = {logLevel: 4,
     errorReporting: "console"};
 less.relativeUrls = true;
-
diff --git a/test/browser/runner-rootpath-options.js b/test/browser/runner-rootpath-options.js
index f1aa52c..ca9e9a4 100644
--- a/test/browser/runner-rootpath-options.js
+++ b/test/browser/runner-rootpath-options.js
@@ -1,4 +1,3 @@
 var less = {logLevel: 4,
     errorReporting: "console"};
 less.rootpath = "https://localhost/";
-
diff --git a/test/browser/runner-rootpath-relative-options.js b/test/browser/runner-rootpath-relative-options.js
index df4d883..641bab8 100644
--- a/test/browser/runner-rootpath-relative-options.js
+++ b/test/browser/runner-rootpath-relative-options.js
@@ -2,4 +2,3 @@ var less = {logLevel: 4,
     errorReporting: "console"};
 less.rootpath = "https://www.github.com/cloudhead/less.js/";
 less.relativeUrls = true;
-
diff --git a/test/browser/runner-strict-units-options.js b/test/browser/runner-strict-units-options.js
index e292310..4353405 100644
--- a/test/browser/runner-strict-units-options.js
+++ b/test/browser/runner-strict-units-options.js
@@ -3,4 +3,3 @@ var less = {
     errorReporting: "console",
     strictMath: true,
     strictUnits: true };
-
diff --git a/test/less-test.js b/test/less-test.js
index f37a89a..1da1813 100644
--- a/test/less-test.js
+++ b/test/less-test.js
@@ -11,7 +11,7 @@ module.exports = function() {
     var globals = Object.keys(global);
 
     var oneTestOnly = process.argv[2],
-	    isFinished = false;
+        isFinished = false;
 
     var isVerbose = process.env.npm_config_loglevel === 'verbose';
 
@@ -25,10 +25,10 @@ module.exports = function() {
             }
         },
         warn: function(msg) {
-	        process.stdout.write(msg + "\n");
+            process.stdout.write(msg + "\n");
         },
         error: function(msg) {
-	        process.stdout.write(msg + "\n");
+            process.stdout.write(msg + "\n");
         }
     });
 
@@ -36,21 +36,21 @@ module.exports = function() {
         queueRunning = false;
     function queue(func) {
         if (queueRunning) {
-	        //console.log("adding to queue");
+            //console.log("adding to queue");
             queueList.push(func);
         } else {
-	        //console.log("first in queue - starting");
+            //console.log("first in queue - starting");
             queueRunning = true;
             func();
         }
     }
     function release() {
         if (queueList.length) {
-	        //console.log("running next in queue");
+            //console.log("running next in queue");
             var func = queueList.shift();
-	        setTimeout(func, 0);
+            setTimeout(func, 0);
         } else {
-	        //console.log("stopping queue");
+            //console.log("stopping queue");
             queueRunning = false;
         }
     }
@@ -129,10 +129,10 @@ module.exports = function() {
     }
 
     function testSyncronous(options, filenameNoExtension) {
-	    if (oneTestOnly && ("Test Sync " + filenameNoExtension) !== oneTestOnly) {
-		    return;
-	    }
-	    totalTests++;
+        if (oneTestOnly && ("Test Sync " + filenameNoExtension) !== oneTestOnly) {
+            return;
+        }
+        totalTests++;
         queue(function() {
         var isSync = true;
         toCSS(options, path.join(normalFolder, filenameNoExtension + ".less"), function (err, result) {
@@ -143,7 +143,7 @@ module.exports = function() {
             } else {
                 fail("Not Sync");
             }
-	        release();
+            release();
         });
         isSync = false;
         });
@@ -200,19 +200,19 @@ module.exports = function() {
             var doubleCallCheck = false;
             queue(function() {
                 toCSS(options, path.join(baseFolder, foldername + file), function (err, result) {
-	            if (doubleCallCheck) {
-		            totalTests++;
-		            fail("less is calling back twice");
-		            process.stdout.write(doubleCallCheck + "\n");
-		            process.stdout.write((new Error()).stack + "\n");
-		            return;
-	            }
-	            doubleCallCheck = (new Error()).stack;
+                if (doubleCallCheck) {
+                    totalTests++;
+                    fail("less is calling back twice");
+                    process.stdout.write(doubleCallCheck + "\n");
+                    process.stdout.write((new Error()).stack + "\n");
+                    return;
+                }
+                doubleCallCheck = (new Error()).stack;
 
                 if (verifyFunction) {
                     var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map, baseFolder);
-	                release();
-	                return verificationResult;
+                    release();
+                    return verificationResult;
                 }
                 if (err) {
                     fail("ERROR: " + (err && err.message));
@@ -271,16 +271,16 @@ module.exports = function() {
         passedTests++;
         endTest();
     }
-	
-	function finished() {
-		isFinished = true;
-		endTest();
-	}
+
+    function finished() {
+        isFinished = true;
+        endTest();
+    }
 
     function endTest() {
         if (isFinished && ((failedTests + passedTests) >= totalTests)) {
-	        var leaked = checkGlobalLeaks();
-	        
+            var leaked = checkGlobalLeaks();
+
             process.stdout.write("\n");
             if (failedTests > 0) {
                 process.stdout.write(failedTests + stylize(" Failed", "red") + ", " + passedTests + " passed\n");
@@ -307,8 +307,7 @@ module.exports = function() {
         return false;
     }
 
-
-  function toCSS(options, path, callback) {
+    function toCSS(options, path, callback) {
         options = options || {};
         var str = fs.readFileSync(path, 'utf8'), addPath = require('path').dirname(path);
 
@@ -329,9 +328,9 @@ module.exports = function() {
     }
 
     function testNoOptions() {
-	    if (oneTestOnly && "Integration" !== oneTestOnly) {
-		    return;
-	    }
+        if (oneTestOnly && "Integration" !== oneTestOnly) {
+            return;
+        }
         totalTests++;
         try {
             process.stdout.write("- Integration - creating parser without options: ");
@@ -351,6 +350,6 @@ module.exports = function() {
         testSourcemap: testSourcemap,
         testNoOptions: testNoOptions,
         prepBomTest: prepBomTest,
-	    finished: finished
+        finished: finished
     };
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list