feat(mod_format): feat(mod_format): use unified diff formatter with filenames and context in BaseFormatter.displayDiff
This commit is contained in:
@@ -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.'
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user