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({ return sequential({
tasks: [ tasks: [
{ {
type: "dotnetcheckstyle" type: "dotnetcheckstyle",
params: params
}, },
{ {
type: "dotnetrewrite", type: "dotnetrewrite",
params: { params: params
skipCodeSigning: params.skipCodeSigning
}
}, },
{ {
type: "dotnetnugetrestore", type: "dotnetnugetrestore",
params: { params: params
solution: params.solution
}
}, },
{ {
type: "dotnetbuilderwrapper", type: "dotnetbuilderwrapper",

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

@ -26,7 +26,7 @@ module.exports = function (params, processor) {
processor.onInfo("Found " + files.length + " .cs files"); processor.onInfo("Found " + files.length + " .cs files");
if (!files || !files.length) { if (!files || !files.length) {
processor.onWarn("No AssemblyInfo.cs found"); processor.onWarn("No .cs files found");
return processor.done(); return processor.done();
} }
@ -35,16 +35,26 @@ module.exports = function (params, processor) {
return fs.readFile(processor.context.exported + "/" + file, { encoding: "utf8" }, function (err, data) { return fs.readFile(processor.context.exported + "/" + file, { encoding: "utf8" }, function (err, data) {
if (err) { if (err) {
processor.onError("Unable to check file " + file + ": " + 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); 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); 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); 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)); }), processor.done.bind(processor));

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

Loading…
Cancel
Save