From 1b1ede13f958bc479b5e196da39855e7959c8b14 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Wed, 27 May 2026 11:48:07 +0200 Subject: [PATCH] feat: add actionable message on lint-locale failure (#12748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this PR: ![image](/attachments/dd1a8f68-8b87-41e5-86e0-4ba59cedf4f4) After this PR: ![image](/attachments/51007bbd-cf3c-4828-b5fc-9aecc9c958bd) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12748 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Reviewed-by: Michael Kriese Reviewed-by: Ellen Εμίλια Άννα Zscheile --- build/lint-locale/lint-locale.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build/lint-locale/lint-locale.go b/build/lint-locale/lint-locale.go index dc4088c73c..03ddab616e 100644 --- a/build/lint-locale/lint-locale.go +++ b/build/lint-locale/lint-locale.go @@ -191,5 +191,24 @@ func main() { } } + if exitCode != 0 { + fmt.Println(dmp.DiffPrettyText([]diffmatchpatch.Diff{{ + Type: diffmatchpatch.DiffEqual, + Text: "Please adjust the locale files as suggested above (", + }, { + Type: diffmatchpatch.DiffDelete, + Text: "red", + }, { + Type: diffmatchpatch.DiffEqual, + Text: ": removal, ", + }, { + Type: diffmatchpatch.DiffInsert, + Text: "green", + }, { + Type: diffmatchpatch.DiffEqual, + Text: ": insertion)", + }})) + } + os.Exit(exitCode) }