ignoreCodeStyle param implemented; refactoring

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 9 years ago
parent 6c4d2345e7
commit be2604f961
  1. 11
      BuildServer/lib/tasks/dotnetbuild.js
  2. 4
      BuildServer/lib/tasks/dotnetbuildandtest.js
  3. 24
      BuildServer/lib/tasks/dotnetcheckstyle.js
  4. 4
      BuildServer/lib/tasks/dotnetpack.js

@ -6,19 +6,16 @@ module.exports = function (params, processor) {
return sequential({
tasks: [
{
type: "dotnetcheckstyle"
type: "dotnetcheckstyle",
params: params
},
{
type: "dotnetrewrite",
params: {
skipCodeSigning: params.skipCodeSigning
}
params: params
},
{
type: "dotnetnugetrestore",
params: {
solution: params.solution
}
params: params
},
{
type: "dotnetbuilderwrapper",

@ -9,9 +9,7 @@ module.exports = function (params, processor) {
{
type: "dotnetbuild",
name: "build",
params: {
solution: params.solution
}
params: params
},
{
type: "dotnetnunitall",

@ -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));

@ -7,9 +7,7 @@ module.exports = function (params, processor) {
tasks: [
{
type: "dotnetrewrite",
params: {
skipCodeSigning: params.skipCodeSigning
}
params: params
},
{
type: "dotnetbuilderwrapper",

Loading…
Cancel
Save