Skip to content

Commit ce06d3f

Browse files
minor lint fixes
1 parent 1f6b9c4 commit ce06d3f

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/autoupdater.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,19 @@ export class AutoUpdater {
491491
ghCore.info('Merge conflict detected, skipping update.');
492492
return false;
493493
} else if (mergeConflictAction === 'label') {
494-
ghCore.info('Merge conflict detected, labelling with label: ' + mergeConflictLabel);
494+
ghCore.info(
495+
'Merge conflict detected, labelling with label: ' +
496+
mergeConflictLabel,
497+
);
495498
// Fetch current labels on the PR
496499
const { data: prData } = await this.octokit.rest.pulls.get({
497500
owner: mergeOpts.owner as string,
498501
repo: mergeOpts.repo as string,
499502
pull_number: prNumber,
500503
});
501-
const currentLabels = prData.labels.map((l: any) => l.name).filter(Boolean);
504+
const currentLabels = prData.labels
505+
.map((l: any) => l.name)
506+
.filter(Boolean);
502507
if (!currentLabels.includes(mergeConflictLabel)) {
503508
const newLabels = [...currentLabels, mergeConflictLabel];
504509
await this.octokit.rest.issues.update({
@@ -507,9 +512,13 @@ export class AutoUpdater {
507512
issue_number: prNumber,
508513
labels: newLabels,
509514
});
510-
ghCore.info(`Added merge conflict label '${mergeConflictLabel}' to PR #${prNumber}.`);
515+
ghCore.info(
516+
`Added merge conflict label '${mergeConflictLabel}' to PR #${prNumber}.`,
517+
);
511518
} else {
512-
ghCore.info(`Merge conflict label '${mergeConflictLabel}' already present on PR #${prNumber}.`);
519+
ghCore.info(
520+
`Merge conflict label '${mergeConflictLabel}' already present on PR #${prNumber}.`,
521+
);
513522
}
514523
return false;
515524
} else {

test/autoupdate.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ describe('test `merge`', () => {
13631363
expect(getScope.isDone()).toBe(true);
13641364
expect(updateScope.isDone()).toBe(false);
13651365
expect(infoSpy).toHaveBeenCalledWith(
1366-
expect.stringContaining("already present")
1366+
expect.stringContaining('already present'),
13671367
);
13681368
});
13691369

@@ -1375,9 +1375,7 @@ describe('test `merge`', () => {
13751375

13761376
// Mock the PR labels to already include the merge conflict label
13771377
const prNumber = 1;
1378-
const existingLabels = [
1379-
{ id: 1, name: 'bug' },
1380-
];
1378+
const existingLabels = [{ id: 1, name: 'bug' }];
13811379

13821380
// nock for merge attempt (409 merge conflict)
13831381
const mergeScope = nock('https://api.github.com:443')
@@ -1405,7 +1403,7 @@ describe('test `merge`', () => {
14051403
expect(getScope.isDone()).toBe(true);
14061404
expect(updateScope.isDone()).toBe(false);
14071405
expect(infoSpy).toHaveBeenCalledWith(
1408-
expect.stringContaining("Added merge conflict label")
1406+
expect.stringContaining('Added merge conflict label'),
14091407
);
14101408
});
14111409
});

0 commit comments

Comments
 (0)