Skip to content

Commit f1d6b7b

Browse files
committed
refactor: rename noop to nop for consistency
1 parent 0aa2e9c commit f1d6b7b

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

full-sync.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const appFn = require('./')
2-
const { FULL_SYNC_NOOP } = require('./lib/env')
2+
const { FULL_SYNC_NOP } = require('./lib/env')
33
const { createProbot } = require('probot')
44

5-
async function performFullSync (appFn, noop) {
5+
async function performFullSync (appFn, nop) {
66
const probot = createProbot()
7-
probot.log.info(`Starting full sync with NOOP=${noop}`)
7+
probot.log.info(`Starting full sync with NOP=${nop}`)
88

99
try {
1010
const app = appFn(probot, {})
11-
const settings = await app.syncInstallation(noop)
11+
const settings = await app.syncInstallation(nop)
1212

1313
if (settings.errors && settings.errors.length > 0) {
1414
probot.log.error('Errors occurred during full sync.')
@@ -22,7 +22,7 @@ async function performFullSync (appFn, noop) {
2222
}
2323
}
2424

25-
performFullSync(appFn, FULL_SYNC_NOOP).catch((error) => {
25+
performFullSync(appFn, FULL_SYNC_NOP).catch((error) => {
2626
console.error('Fatal error during full sync:', error)
2727
process.exit(1)
2828
})

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
230230
}
231231
}
232232

233-
async function syncInstallation (noop = false) {
233+
async function syncInstallation (nop = false) {
234234
robot.log.trace('Fetching installations')
235235
const github = await robot.auth()
236236

@@ -249,7 +249,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
249249
log: robot.log,
250250
repo: () => { return { repo: env.ADMIN_REPO, owner: installation.account.login } }
251251
}
252-
return syncAllSettings(noop, context)
252+
return syncAllSettings(nop, context)
253253
}
254254
return null
255255
}

lib/env.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = {
66
CREATE_PR_COMMENT: process.env.CREATE_PR_COMMENT || 'true',
77
CREATE_ERROR_ISSUE: process.env.CREATE_ERROR_ISSUE || 'true',
88
BLOCK_REPO_RENAME_BY_HUMAN: process.env.BLOCK_REPO_RENAME_BY_HUMAN || 'false',
9-
FULL_SYNC_NOOP: process.env.FULL_SYNC_NOOP === 'true'
9+
FULL_SYNC_NOP: process.env.FULL_SYNC_NOP === 'true'
1010
}

test/unit/lib/env.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ describe('env', () => {
2828
expect(CREATE_PR_COMMENT).toEqual('true')
2929
})
3030

31-
it('loads default FULL_SYNC_NOOP if not passed', () => {
32-
const FULL_SYNC_NOOP = envTest.FULL_SYNC_NOOP
33-
expect(FULL_SYNC_NOOP).toEqual(false)
31+
it('loads default FULL_SYNC_NOP if not passed', () => {
32+
const FULL_SYNC_NOP = envTest.FULL_SYNC_NOP
33+
expect(FULL_SYNC_NOP).toEqual(false)
3434
})
3535
})
3636

@@ -42,7 +42,7 @@ describe('env', () => {
4242
process.env.SETTINGS_FILE_PATH = 'safe-settings.yml'
4343
process.env.DEPLOYMENT_CONFIG_FILE = 'safe-settings-deployment.yml'
4444
process.env.CREATE_PR_COMMENT = 'false'
45-
process.env.FULL_SYNC_NOOP = false
45+
process.env.FULL_SYNC_NOP = false
4646
})
4747

4848
it('loads override values if passed', () => {
@@ -57,8 +57,8 @@ describe('env', () => {
5757
expect(DEPLOYMENT_CONFIG_FILE).toEqual('safe-settings-deployment.yml')
5858
const CREATE_PR_COMMENT = envTest.CREATE_PR_COMMENT
5959
expect(CREATE_PR_COMMENT).toEqual('false')
60-
const FULL_SYNC_NOOP = envTest.FULL_SYNC_NOOP
61-
expect(FULL_SYNC_NOOP).toEqual(false)
60+
const FULL_SYNC_NOP = envTest.FULL_SYNC_NOP
61+
expect(FULL_SYNC_NOP).toEqual(false)
6262
})
6363
})
6464
})

test/unit/lib/plugins/branches.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ describe('Branches', () => {
1010
log.error = jest.fn()
1111

1212
function configure (config) {
13-
const noop = false
13+
const nop = false
1414
const errors = []
15-
return new Branches(noop, github, { owner: 'bkeepers', repo: 'test' }, config, log, errors)
15+
return new Branches(nop, github, { owner: 'bkeepers', repo: 'test' }, config, log, errors)
1616
}
1717

1818
beforeEach(() => {

test/unit/lib/plugins/repository.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ describe('Repository', () => {
1717
log.error = jest.fn()
1818

1919
function configure (config) {
20-
const noop = false
20+
const nop = false
2121
const errors = []
22-
return new Repository(noop, github, { owner: 'bkeepers', repo: 'test' }, config, 1, log, errors)
22+
return new Repository(nop, github, { owner: 'bkeepers', repo: 'test' }, config, 1, log, errors)
2323
}
2424

2525
describe('sync', () => {

0 commit comments

Comments
 (0)