diff --git a/changelog.md b/changelog.md index 92676a5..fa03c7d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-12-15 - 2.11.0 - feat(mod_format) +feat(mod_format): use unified diff formatter with filenames and context in BaseFormatter.displayDiff + +- Replaced plugins.smartdiff.formatLineDiffForConsole(...) with plugins.smartdiff.formatUnifiedDiffForConsole(...) when both before and after are present. +- Passes originalFileName and revisedFileName as diff.path and sets context to 3 to show a unified diff with surrounding lines. +- Improves console output for multi-line diffs by using unified diff format and including file names. + ## 2025-12-15 - 2.10.0 - feat(mod_format) Refactor formatting modules to new BaseFormatter and implement concrete analyze/apply logic diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 12c02a5..76e3138 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/cli', - version: '2.10.0', + version: '2.11.0', description: '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.' } diff --git a/ts/mod_format/classes.baseformatter.ts b/ts/mod_format/classes.baseformatter.ts index 4138c09..f0fb47a 100644 --- a/ts/mod_format/classes.baseformatter.ts +++ b/ts/mod_format/classes.baseformatter.ts @@ -143,7 +143,11 @@ export abstract class BaseFormatter { displayDiff(diff: ICheckResult['diffs'][0]): void { console.log(`\n--- ${diff.path}`); if (diff.before && diff.after) { - console.log(plugins.smartdiff.formatLineDiffForConsole(diff.before, diff.after)); + console.log(plugins.smartdiff.formatUnifiedDiffForConsole(diff.before, diff.after, { + originalFileName: diff.path, + revisedFileName: diff.path, + context: 3, + })); } else if (diff.after && !diff.before) { console.log(' (new file)'); // Show first few lines of new content