From 78a0251472176241a4f68cf3a6b3b96d24c89b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 4 Dec 2025 16:23:01 +0200 Subject: [PATCH] fix(fixer): dedupe error message on conflicts from the same linter For example, modernize's omitzero produces this. Better to say > conflicting edits from modernize on ... ...than: > conflicting edits from modernize and modernize on ... --- pkg/result/processors/fixer.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/result/processors/fixer.go b/pkg/result/processors/fixer.go index ce33b27fb276..0422b0622716 100644 --- a/pkg/result/processors/fixer.go +++ b/pkg/result/processors/fixer.go @@ -301,6 +301,10 @@ func diff3Conflict(path, xlabel, ylabel string, xedits, yedits []diff.Edit) erro return err } - return fmt.Errorf("conflicting edits from %s and %s on %s\nfirst edits:\n%s\nsecond edits:\n%s", - xlabel, ylabel, path, xdiff, ydiff) + from := xlabel + if from != ylabel { + from += " and " + ylabel + } + return fmt.Errorf("conflicting edits from %s on %s\nfirst edits:\n%s\nsecond edits:\n%s", + from, path, xdiff, ydiff) }