From 65fb8a4b76d39a197cda75d44f03d1cf258a927a Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 23 Jan 2015 13:42:38 +0300 Subject: [PATCH] Spacing consistence check added --- BuildServer/lib/tasks/dotnetcheckstyle.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BuildServer/lib/tasks/dotnetcheckstyle.js b/BuildServer/lib/tasks/dotnetcheckstyle.js index 5747d45..d3d2c97 100644 --- a/BuildServer/lib/tasks/dotnetcheckstyle.js +++ b/BuildServer/lib/tasks/dotnetcheckstyle.js @@ -30,11 +30,13 @@ module.exports = function (params, processor) { return function (callback) { return fs.readFile(processor.context.exported + "/" + file, { encoding: "utf8" }, function (err, data) { if (err) { - processor.onError("Unable to rewrite file " + file + ": " + err); + processor.onError("Unable to check file " + file + ": " + err); } else if (data.indexOf("\r\n") >= 0) { processor.onError("Windows-style EOL (0D0A) found in file " + file); + } else if (data.indexOf("\t") >= 0 && data.indexOf(" ") >= 0) { + processor.onError("Both tabs and spaces found in file " + file); } else { - processor.onInfo("Rewritten file " + file); + processor.onInfo("Checked file " + file); } callback(err); });