|
|
|
@ -26,7 +26,7 @@ module.exports = function (params, processor) { |
|
|
|
|
processor.onInfo("Found " + files.length + " .cs files"); |
|
|
|
|
|
|
|
|
|
if (!files || !files.length) { |
|
|
|
|
processor.onWarn("No AssemblyInfo.cs found"); |
|
|
|
|
processor.onWarn("No .cs files found"); |
|
|
|
|
return processor.done(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -35,16 +35,26 @@ module.exports = function (params, processor) { |
|
|
|
|
return fs.readFile(processor.context.exported + "/" + file, { encoding: "utf8" }, function (err, data) { |
|
|
|
|
if (err) { |
|
|
|
|
processor.onError("Unable to check file " + file + ": " + err); |
|
|
|
|
} else if (data.indexOf("\r\n") >= 0) { |
|
|
|
|
return callback(err); |
|
|
|
|
} |
|
|
|
|
if (data.indexOf("\r\n") >= 0) { |
|
|
|
|
processor.onError("Windows-style EOL (0D0A) found in file " + file); |
|
|
|
|
} else if (data.substr(1, autoGeneratedMarker.length) === autoGeneratedMarker || data.substr(0, autoGeneratedMarker.length) === autoGeneratedMarker) { |
|
|
|
|
return callback(); |
|
|
|
|
} |
|
|
|
|
if (params.ignoreCodeStyle) { |
|
|
|
|
return callback(); |
|
|
|
|
} |
|
|
|
|
if (data.substr(1, autoGeneratedMarker.length) === autoGeneratedMarker || data.substr(0, autoGeneratedMarker.length) === autoGeneratedMarker) { |
|
|
|
|
processor.onInfo("Skipping auto-generated file " + file); |
|
|
|
|
} else if (data.indexOf("\t") >= 0 && data.indexOf(" ") >= 0) { |
|
|
|
|
return callback(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data.indexOf("\t") >= 0 && data.indexOf(" ") >= 0) { |
|
|
|
|
processor.onError("Both tabs and spaces found in file " + file); |
|
|
|
|
} else { |
|
|
|
|
processor.onInfo("Checked file " + file); |
|
|
|
|
} |
|
|
|
|
callback(err); |
|
|
|
|
|
|
|
|
|
processor.onInfo("Checked file " + file); |
|
|
|
|
callback(); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
}), processor.done.bind(processor)); |
|
|
|
|