fix linting
This commit is contained in:
parent
e0c4e25b76
commit
8fb3b504a0
|
@ -52,7 +52,8 @@ export class IssuesProcessor {
|
||||||
|
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
LoggerService.cyan(consumedOperationsCount),
|
LoggerService.cyan(consumedOperationsCount),
|
||||||
`operation${consumedOperationsCount > 1 ? 's' : ''
|
`operation${
|
||||||
|
consumedOperationsCount > 1 ? 's' : ''
|
||||||
} consumed for this $$type`
|
} consumed for this $$type`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -256,7 +257,6 @@ export class IssuesProcessor {
|
||||||
? this._getDaysBeforePrStale()
|
? this._getDaysBeforePrStale()
|
||||||
: this._getDaysBeforeIssueStale();
|
: this._getDaysBeforeIssueStale();
|
||||||
|
|
||||||
|
|
||||||
if (issue.state === 'closed') {
|
if (issue.state === 'closed') {
|
||||||
issueLogger.info(`Skipping this $$type because it is closed`);
|
issueLogger.info(`Skipping this $$type because it is closed`);
|
||||||
IssuesProcessor._endIssueProcessing(issue);
|
IssuesProcessor._endIssueProcessing(issue);
|
||||||
|
@ -368,7 +368,6 @@ export class IssuesProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if the issue is stale, if not, check if it is rotten and then log the findings.
|
// Check if the issue is stale, if not, check if it is rotten and then log the findings.
|
||||||
if (issue.isStale) {
|
if (issue.isStale) {
|
||||||
issueLogger.info(`This $$type includes a stale label`);
|
issueLogger.info(`This $$type includes a stale label`);
|
||||||
|
@ -376,8 +375,7 @@ export class IssuesProcessor {
|
||||||
issueLogger.info(`This $$type does not include a stale label`);
|
issueLogger.info(`This $$type does not include a stale label`);
|
||||||
if (issue.isRotten) {
|
if (issue.isRotten) {
|
||||||
issueLogger.info(`This $$type includes a rotten label`);
|
issueLogger.info(`This $$type includes a rotten label`);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
issueLogger.info(`This $$type does not include a rotten label`);
|
issueLogger.info(`This $$type does not include a rotten label`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -495,8 +493,7 @@ export class IssuesProcessor {
|
||||||
closeMessage,
|
closeMessage,
|
||||||
closeLabel
|
closeLabel
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
|
const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
|
||||||
this.options,
|
this.options,
|
||||||
issue
|
issue
|
||||||
|
@ -587,7 +584,7 @@ export class IssuesProcessor {
|
||||||
labelsToAddWhenUnrotten,
|
labelsToAddWhenUnrotten,
|
||||||
labelsToRemoveWhenUnrotten,
|
labelsToRemoveWhenUnrotten,
|
||||||
labelsToRemoveWhenRotten,
|
labelsToRemoveWhenRotten,
|
||||||
skipRottenMessage,
|
skipRottenMessage
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,7 +721,7 @@ export class IssuesProcessor {
|
||||||
) {
|
) {
|
||||||
const issueLogger: IssueLogger = new IssueLogger(issue);
|
const issueLogger: IssueLogger = new IssueLogger(issue);
|
||||||
|
|
||||||
var issueHasClosed: boolean = false
|
let issueHasClosed: boolean = false;
|
||||||
|
|
||||||
// We can get the label creation date from the getLableCreationDate function
|
// We can get the label creation date from the getLableCreationDate function
|
||||||
const markedStaleOn: string =
|
const markedStaleOn: string =
|
||||||
|
@ -826,17 +823,15 @@ export class IssuesProcessor {
|
||||||
`Stale $$type cannot be rotten or closed because days before rotten: ${daysBeforeRotten}, and days before close: ${daysBeforeClose}`
|
`Stale $$type cannot be rotten or closed because days before rotten: ${daysBeforeRotten}, and days before close: ${daysBeforeClose}`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`Closing issue without rottening it because days before $$type rotten: ${LoggerService.cyan(daysBeforeRotten)}`
|
`Closing issue without rottening it because days before $$type rotten: ${LoggerService.cyan(
|
||||||
|
daysBeforeRotten
|
||||||
|
)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
let issueHasUpdateInCloseWindow: boolean
|
const issueHasUpdateInCloseWindow: boolean =
|
||||||
issueHasUpdateInCloseWindow = IssuesProcessor._updatedSince(
|
IssuesProcessor._updatedSince(issue.updated_at, daysBeforeClose);
|
||||||
issue.updated_at,
|
|
||||||
daysBeforeClose
|
|
||||||
);
|
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`$$type has been updated in the last ${daysBeforeClose} days: ${LoggerService.cyan(
|
`$$type has been updated in the last ${daysBeforeClose} days: ${LoggerService.cyan(
|
||||||
issueHasUpdateInCloseWindow
|
issueHasUpdateInCloseWindow
|
||||||
|
@ -887,8 +882,7 @@ export class IssuesProcessor {
|
||||||
issue
|
issue
|
||||||
).shouldIgnoreUpdates();
|
).shouldIgnoreUpdates();
|
||||||
|
|
||||||
let shouldBeRotten: boolean;
|
const shouldBeRotten: boolean = !IssuesProcessor._updatedSince(
|
||||||
shouldBeRotten = !IssuesProcessor._updatedSince(
|
|
||||||
issue.updated_at,
|
issue.updated_at,
|
||||||
daysBeforeRotten
|
daysBeforeRotten
|
||||||
);
|
);
|
||||||
|
@ -914,7 +908,12 @@ export class IssuesProcessor {
|
||||||
this._getDaysBeforeRottenUsedOptionName(issue)
|
this._getDaysBeforeRottenUsedOptionName(issue)
|
||||||
)} (${LoggerService.cyan(daysBeforeRotten)})`
|
)} (${LoggerService.cyan(daysBeforeRotten)})`
|
||||||
);
|
);
|
||||||
await this._markRotten(issue, rottenMessage, rottenLabel, skipMessage);
|
await this._markRotten(
|
||||||
|
issue,
|
||||||
|
rottenMessage,
|
||||||
|
rottenLabel,
|
||||||
|
skipMessage
|
||||||
|
);
|
||||||
issue.isRotten = true; // This issue is now considered rotten
|
issue.isRotten = true; // This issue is now considered rotten
|
||||||
issue.markedRottenThisRun = true;
|
issue.markedRottenThisRun = true;
|
||||||
issueLogger.info(`This $$type is now rotten`);
|
issueLogger.info(`This $$type is now rotten`);
|
||||||
|
@ -952,10 +951,9 @@ export class IssuesProcessor {
|
||||||
labelsToRemoveWhenUnrotten,
|
labelsToRemoveWhenUnrotten,
|
||||||
labelsToRemoveWhenRotten,
|
labelsToRemoveWhenRotten,
|
||||||
closeMessage,
|
closeMessage,
|
||||||
closeLabel,
|
closeLabel
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private async _processRottenIssue(
|
private async _processRottenIssue(
|
||||||
issue: Issue,
|
issue: Issue,
|
||||||
|
@ -1054,7 +1052,9 @@ export class IssuesProcessor {
|
||||||
);
|
);
|
||||||
await this._addLabelsWhenUnrotten(issue, labelsToAddWhenUnrotten);
|
await this._addLabelsWhenUnrotten(issue, labelsToAddWhenUnrotten);
|
||||||
|
|
||||||
issueLogger.info(`Skipping the process since the $$type is now un-rotten`);
|
issueLogger.info(
|
||||||
|
`Skipping the process since the $$type is now un-rotten`
|
||||||
|
);
|
||||||
|
|
||||||
return; // Nothing to do because it is no longer rotten
|
return; // Nothing to do because it is no longer rotten
|
||||||
}
|
}
|
||||||
|
@ -1237,7 +1237,6 @@ export class IssuesProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Close an issue based on staleness
|
// Close an issue based on staleness
|
||||||
private async _closeIssue(
|
private async _closeIssue(
|
||||||
issue: Issue,
|
issue: Issue,
|
||||||
|
@ -1357,7 +1356,8 @@ export class IssuesProcessor {
|
||||||
issueLogger.warning(
|
issueLogger.warning(
|
||||||
`Deleting the branch "${LoggerService.cyan(
|
`Deleting the branch "${LoggerService.cyan(
|
||||||
branch
|
branch
|
||||||
)}" has skipped because it belongs to other repo ${pullRequest.head.repo.full_name
|
)}" has skipped because it belongs to other repo ${
|
||||||
|
pullRequest.head.repo.full_name
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1372,7 +1372,8 @@ export class IssuesProcessor {
|
||||||
const issueLogger: IssueLogger = new IssueLogger(issue);
|
const issueLogger: IssueLogger = new IssueLogger(issue);
|
||||||
|
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`${isSubStep ? LoggerService.white('├── ') : ''
|
`${
|
||||||
|
isSubStep ? LoggerService.white('├── ') : ''
|
||||||
}Removing the label "${LoggerService.cyan(label)}" from this $$type...`
|
}Removing the label "${LoggerService.cyan(label)}" from this $$type...`
|
||||||
);
|
);
|
||||||
this.removedLabelIssues.push(issue);
|
this.removedLabelIssues.push(issue);
|
||||||
|
@ -1391,12 +1392,14 @@ export class IssuesProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`${isSubStep ? LoggerService.white('└── ') : ''
|
`${
|
||||||
|
isSubStep ? LoggerService.white('└── ') : ''
|
||||||
}The label "${LoggerService.cyan(label)}" was removed`
|
}The label "${LoggerService.cyan(label)}" was removed`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
issueLogger.error(
|
issueLogger.error(
|
||||||
`${isSubStep ? LoggerService.white('└── ') : ''
|
`${
|
||||||
|
isSubStep ? LoggerService.white('└── ') : ''
|
||||||
}Error when removing the label: "${LoggerService.cyan(error.message)}"`
|
}Error when removing the label: "${LoggerService.cyan(error.message)}"`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1437,7 +1440,6 @@ export class IssuesProcessor {
|
||||||
: this.options.daysBeforePrClose;
|
: this.options.daysBeforePrClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private _getOnlyLabels(issue: Issue): string {
|
private _getOnlyLabels(issue: Issue): string {
|
||||||
if (issue.isPullRequest) {
|
if (issue.isPullRequest) {
|
||||||
if (this.options.onlyPrLabels !== '') {
|
if (this.options.onlyPrLabels !== '') {
|
||||||
|
@ -1523,7 +1525,6 @@ export class IssuesProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async _addLabelsWhenUnstale(
|
private async _addLabelsWhenUnstale(
|
||||||
issue: Issue,
|
issue: Issue,
|
||||||
labelsToAdd: Readonly<string>[]
|
labelsToAdd: Readonly<string>[]
|
||||||
|
|
|
@ -80,7 +80,6 @@ export class Statistics {
|
||||||
return this._incrementUndoRottenIssuesCount(increment);
|
return this._incrementUndoRottenIssuesCount(increment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setOperationsCount(operationsCount: Readonly<number>): Statistics {
|
setOperationsCount(operationsCount: Readonly<number>): Statistics {
|
||||||
this.operationsCount = operationsCount;
|
this.operationsCount = operationsCount;
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ export enum Option {
|
||||||
LabelsToRemoveWhenUnstale = 'labels-to-remove-when-unstale',
|
LabelsToRemoveWhenUnstale = 'labels-to-remove-when-unstale',
|
||||||
LabelsToAddWhenUnstale = 'labels-to-add-when-unstale',
|
LabelsToAddWhenUnstale = 'labels-to-add-when-unstale',
|
||||||
LabelsToRemoveWhenRotten = 'labels-to-remove-when-rotten',
|
LabelsToRemoveWhenRotten = 'labels-to-remove-when-rotten',
|
||||||
LabelsToRemoveWhenUnrotten = 'labels-to-remove-when-unstale',
|
LabelsToRemoveWhenUnrotten = 'labels-to-remove-when-unrotten',
|
||||||
LabelsToAddWhenUnrotten = 'labels-to-add-when-unstale',
|
LabelsToAddWhenUnrotten = 'labels-to-add-when-unrotten',
|
||||||
IgnoreUpdates = 'ignore-updates',
|
IgnoreUpdates = 'ignore-updates',
|
||||||
IgnoreIssueUpdates = 'ignore-issue-updates',
|
IgnoreIssueUpdates = 'ignore-issue-updates',
|
||||||
IgnorePrUpdates = 'ignore-pr-updates',
|
IgnorePrUpdates = 'ignore-pr-updates',
|
||||||
|
|
|
@ -72,7 +72,9 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||||
),
|
),
|
||||||
daysBeforeIssueStale: parseFloat(core.getInput('days-before-issue-stale')),
|
daysBeforeIssueStale: parseFloat(core.getInput('days-before-issue-stale')),
|
||||||
daysBeforePrStale: parseFloat(core.getInput('days-before-pr-stale')),
|
daysBeforePrStale: parseFloat(core.getInput('days-before-pr-stale')),
|
||||||
daysBeforeIssueRotten: parseFloat(core.getInput('days-before-issue-rotten')),
|
daysBeforeIssueRotten: parseFloat(
|
||||||
|
core.getInput('days-before-issue-rotten')
|
||||||
|
),
|
||||||
daysBeforePrRotten: parseFloat(core.getInput('days-before-pr-rotten')),
|
daysBeforePrRotten: parseFloat(core.getInput('days-before-pr-rotten')),
|
||||||
daysBeforeClose: parseInt(
|
daysBeforeClose: parseInt(
|
||||||
core.getInput('days-before-close', {required: true})
|
core.getInput('days-before-close', {required: true})
|
||||||
|
|
Loading…
Reference in New Issue