Skip to content

Commit

Permalink
ci: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
killagu committed Sep 20, 2024
1 parent d590002 commit 57fa1ca
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
1 change: 0 additions & 1 deletion bin/xtransit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
'use strict';

const os = require('os');
const fs = require('fs');
const path = require('path');
const moment = require('moment');
Expand Down
1 change: 0 additions & 1 deletion commands/xprofctl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');
const { promisify } = require('util');
const exists = promisify(fs.exists);
Expand Down
2 changes: 1 addition & 1 deletion common/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Parser {
reject(err);
};

cleanup = function () {
cleanup = function() {
readable.removeListener('data', onData);
readable.removeListener('end', onEnd);
readable.removeListener('error', onError);
Expand Down
12 changes: 6 additions & 6 deletions common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ exports.getNodeProcessInfo = function(proc, platform) {

exports.sleep = promisify(setTimeout);

exports.getXprofilerPath = function () {
exports.getXprofilerPath = function() {
const prefix = process.env.XPROFILER_PREFIX || process.env.XPROFILER_UNIT_TEST_TMP_HOMEDIR || os.homedir();
return path.join(prefix, '.xprofiler');
}
};

exports.getXtransitPath = function () {
exports.getXtransitPath = function() {
const prefix = process.env.XTRANSIT_PREFIX || process.env.XPROFILER_UNIT_TEST_TMP_HOMEDIR || os.homedir();
return path.join(prefix, '.xtransit');
}
};

exports.getXtransitLogPath = function () {
exports.getXtransitLogPath = function() {
const prefix = process.env.XTRANSIT_PREFIX || process.env.XPROFILER_UNIT_TEST_TMP_HOMEDIR || os.homedir();
return path.join(prefix, '.xtransit.log');
}
};
2 changes: 1 addition & 1 deletion orders/xprofiler_log.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ exports = module.exports = async function() {
lines: process.env.UNIT_TEST && logs[0] ? logs[0].split('\n').length : 0,
};

if(typeof this.customXprofilerLogs === 'function') {
if (typeof this.customXprofilerLogs === 'function') {
const logs = message.data.logs;
logs.push(...await this.customXprofilerLogs(logs));
}
Expand Down
2 changes: 2 additions & 0 deletions test/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function getError(config) {
}

describe('get config', function() {
afterEach(mm.restore);

it('should throw error', function() {
expect(getError({})).to.be('config.server must be passed in!');
expect(getError({ server: 'mock' })).to.be('config.server must be passed in!');
Expand Down
8 changes: 4 additions & 4 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const assert = require('assert');
const mm = require('mm');
const os = require('os');

describe('utils.test.js', function () {
describe('utils.test.js', function() {
afterEach(mm.restore);

describe('get xprofiler path', () => {
Expand All @@ -17,7 +17,7 @@ describe('utils.test.js', function () {

it('should work default is home', () => {
mm(os, 'homedir', () => {
return '/home/xxx'
return '/home/xxx';
});
const p = utils.getXprofilerPath();
assert.equal(p, '/home/xxx/.xprofiler');
Expand All @@ -33,7 +33,7 @@ describe('utils.test.js', function () {

it('should work default is home', () => {
mm(os, 'homedir', () => {
return '/home/xxx'
return '/home/xxx';
});
const p = utils.getXtransitPath();
assert.equal(p, '/home/xxx/.xtransit');
Expand All @@ -49,7 +49,7 @@ describe('utils.test.js', function () {

it('should work default is home', () => {
mm(os, 'homedir', () => {
return '/home/xxx'
return '/home/xxx';
});
const p = utils.getXtransitLogPath();
assert.equal(p, '/home/xxx/.xtransit.log');
Expand Down

0 comments on commit 57fa1ca

Please sign in to comment.