fix(format): Improve concurrency control in cache and rollback management with mutex locking and refine formatting details
This commit is contained in:
@@ -7,13 +7,18 @@ export class CleanupFormatter extends BaseFormatter {
|
||||
get name(): string {
|
||||
return 'cleanup';
|
||||
}
|
||||
|
||||
|
||||
async analyze(): Promise<IPlannedChange[]> {
|
||||
const changes: IPlannedChange[] = [];
|
||||
|
||||
|
||||
// List of files to remove
|
||||
const filesToRemove = ['yarn.lock', 'package-lock.json', 'tslint.json', 'defaults.yml'];
|
||||
|
||||
const filesToRemove = [
|
||||
'yarn.lock',
|
||||
'package-lock.json',
|
||||
'tslint.json',
|
||||
'defaults.yml',
|
||||
];
|
||||
|
||||
for (const file of filesToRemove) {
|
||||
const exists = await plugins.smartfile.fs.fileExists(file);
|
||||
if (exists) {
|
||||
@@ -21,14 +26,14 @@ export class CleanupFormatter extends BaseFormatter {
|
||||
type: 'delete',
|
||||
path: file,
|
||||
module: this.name,
|
||||
description: `Remove obsolete file`
|
||||
description: `Remove obsolete file`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return changes;
|
||||
}
|
||||
|
||||
|
||||
async applyChange(change: IPlannedChange): Promise<void> {
|
||||
switch (change.type) {
|
||||
case 'delete':
|
||||
@@ -36,4 +41,4 @@ export class CleanupFormatter extends BaseFormatter {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user