dotnetcheckstyle task added

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 10 years ago
parent f5e405e897
commit cd484d5c93
  1. 5
      BuildServer/lib/tasks/dotnetbuild.js
  2. 46
      BuildServer/lib/tasks/dotnetcheckstyle.js

@ -6,7 +6,10 @@ module.exports = function (params, processor) {
return sequential({ return sequential({
tasks: [ tasks: [
{ {
type: "dotnetrewrite", type: "dotnetcheckstyle"
},
{
type: "dotnetrewrite"
}, },
{ {
type: "dotnetbuilderwrapper", type: "dotnetbuilderwrapper",

@ -0,0 +1,46 @@
"use strict";
var fs = require('fs');
var async = require('async');
var glob = require('glob');
module.exports = function (params, processor) {
return {
process: function () {
if (processor.context.dotnetcheckerDone) {
return processor.done();
}
processor.context.dotnetcheckerDone = true;
glob("**/*.cs", {cwd: processor.context.exported}, function (err, files) {
if (err) {
processor.onError(err);
return processor.done();
}
processor.onInfo("Found " + files.length + " .cs files");
if (!files || !files.length) {
processor.onWarn("No AssemblyInfo.cs found");
return processor.done();
}
return async.parallel(files.map(function (file) {
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);
} else if (data.indexOf("\r\n") >= 0) {
processor.onError("Windows-style EOL (0D0A) found in file " + file);
} else {
processor.onInfo("Rewritten file " + file);
}
callback(err);
});
};
}), processor.done.bind(processor));
});
}
};
};
Loading…
Cancel
Save