@git.zone/cli
Version:
A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.
33 lines (32 loc) • 1.34 kB
TypeScript
import { FormatContext } from './classes.formatcontext.js';
import type { IPlannedChange, ICheckResult } from './interfaces.format.js';
import { Project } from '../classes.project.js';
export declare abstract class BaseFormatter {
protected context: FormatContext;
protected project: Project;
protected stats: any;
constructor(context: FormatContext, project: Project);
abstract get name(): string;
abstract analyze(): Promise<IPlannedChange[]>;
abstract applyChange(change: IPlannedChange): Promise<void>;
execute(changes: IPlannedChange[]): Promise<void>;
protected preExecute(): Promise<void>;
protected postExecute(): Promise<void>;
protected modifyFile(filepath: string, content: string): Promise<void>;
protected createFile(filepath: string, content: string): Promise<void>;
protected deleteFile(filepath: string): Promise<void>;
protected shouldProcessFile(filepath: string): Promise<boolean>;
/**
* Check for diffs without applying changes
* Returns information about what would change
*/
check(): Promise<ICheckResult>;
/**
* Display a single diff using smartdiff
*/
displayDiff(diff: ICheckResult['diffs'][0]): void;
/**
* Display all diffs from a check result
*/
displayAllDiffs(result: ICheckResult): void;
}