feat(mod_format): Add check-only formatting with interactive diff preview; make formatting default to dry-run and extend formatting API

This commit is contained in:
2025-12-14 16:53:18 +00:00
parent 6bd2d35992
commit f444a04876
10 changed files with 192 additions and 30 deletions

View File

@@ -8,10 +8,11 @@ import type { TGitzoneProjectType } from './classes.gitzoneconfig.js';
* the Project class is a tool to work with a gitzone project
*/
export class Project {
public static async fromCwd() {
public static async fromCwd(options: { requireProjectType?: boolean } = {}) {
const gitzoneConfig = await GitzoneConfig.fromCwd();
const project = new Project(gitzoneConfig);
if (!project.gitzoneConfig.data.projectType) {
const requireProjectType = options.requireProjectType ?? true;
if (requireProjectType && !project.gitzoneConfig.data.projectType) {
throw new Error('Please define a project type');
}
return project;