Skip to content

Commit

Permalink
Merge 2dad039 into 1cb9ba5
Browse files Browse the repository at this point in the history
  • Loading branch information
jupe committed Mar 29, 2024
2 parents 1cb9ba5 + 2dad039 commit 803b244
Show file tree
Hide file tree
Showing 13 changed files with 4,680 additions and 4,207 deletions.
21 changes: 19 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
"one-var": ["error", { "initialized": "never" }],
"one-var-declaration-per-line": ["error", "initializations"],
"func-names": ["error", "as-needed"],
"object-shorthand": "off"
"object-shorthand": "off",
"function-paren-newline": "off",
"prefer-object-spread": "off",
"no-multiple-empty-lines": ["error", { "max": 3, "maxEOF": 2 }],
"implicit-arrow-linebreak": "off",
"function-call-argument-newline": "off",
"arrow-parens": "off",
"operator-linebreak": "off",
"import/extensions": "off",
"object-curly-newline": "off",
"import/no-useless-path-segments": "off",
"import/order": "off",
"no-promise-executor-return": "off",
"prefer-destructuring": "off",
"lines-between-class-members": "off",
"max-classes-per-file": "off",
"camelcase": "off",
"default-param-last": "off"
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: sudo docker run -d -p 27017:27017 mongo:4.4.10-focal
- name: api tests
run: |
MOCHA_FILE=junit/apitests.xml grunt apitests --silent
MOCHA_FILE=junit/apitests.xml NODE_OPTIONS=--trace-warnings grunt apitests --silent
- name: cluster tests
run: |
MOCHA_FILE=junit/clustertests.xml grunt clustertests --silent
Expand Down
3 changes: 2 additions & 1 deletion app/addons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ class AddonManager {
logger.info(`Removing addon: [${addon.name}].`);
this.addons.splice(index, 1);
return Promise.resolve();
} else if (addon.isBusy || addon.isRegistered) {
}
if (addon.isBusy || addon.isRegistered) {
// Something is in progress, better not remove
const error = 'Should not remove addon, either busy or registered.';
const meta = {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/controllers/builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BuildsController extends DefaultController {
constructor() { super('Build'); }

static indexParam(req, res, next, Index) {
if (!isNaN(Index)) {
if (Number.isInteger(Number(Index))) {
req.Index = Number.parseInt(Index, 10);
return next();
}
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/passport/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class Github {
}
return user.save();
});
} else if (groupname === 'admins') {
}
if (groupname === 'admins') {
logger.info(`adding user: ${user._id} to admins.`);
return user.addToGroup(groupname);
}
Expand Down
2 changes: 0 additions & 2 deletions app/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const Promise = require('bluebird');
const _ = require('lodash');
const {MongoMemoryServer} = require('mongodb-memory-server');


const logger = require('./tools/logger');
const config = require('./tools/config');

Expand All @@ -26,7 +25,6 @@ const initialize = async function () {
const connect = async function () {
const must = {
logger: logger.info.bind(logger),
promiseLibrary: Promise,
useNewUrlParser: true,
useUnifiedTopology: true
};
Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Promise = require('bluebird');

// application modules
const logger = require('./tools/logger');
const express = require('./express');
const express = require('./app');
const Server = require('./server');
const models = require('./models');
const routes = require('./routes');
Expand Down
6 changes: 4 additions & 2 deletions app/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ class Master {
if (signal) {
logger.warn(`Master process was killed by signal: ${signal}.`);
return 2;
} else if (code !== 0) {
}
if (code !== 0) {
logger.warn(`Master process exited with error code: ${code}.`);
return 1;
}
Expand All @@ -323,7 +324,8 @@ class Master {
if (signal) {
logger.warn(`Worker#${worker.id} process was killed by signal: ${signal}.`);
return 2;
} else if (code !== 0) {
}
if (code !== 0) {
logger.warn(`Worker#${worker.id} process exited with error code: ${code}.`);
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/loan.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function objectToArrayOfObjects(obj) {

// Makes sure the provided date is valid
function isValidDate(date) {
return date !== 'Invalid Date' && !isNaN(date);
return date !== 'Invalid Date' && !Number.isNaN(Number(date));
}


Expand Down
3 changes: 2 additions & 1 deletion app/models/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ async function storeFile(file, i) {
if (fileProvider === 'mongodb') {
file.keepInMongo(i);
return Promise.resolve();
} else if (fileProvider) {
}
if (fileProvider) {
return file.storeInFiledb(filedb, i);
}
file.dumpData(i);
Expand Down
Loading

0 comments on commit 803b244

Please sign in to comment.