From 9693afd671fc9ade1b6b78c1d344beaeea4ae86e Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Wed, 18 May 2022 20:33:35 +0900 Subject: [PATCH] fix: fix lint error --- pkg/app/app.go | 2 +- pkg/gui/controllers/files_controller.go | 2 +- pkg/gui/layout.go | 3 +-- pkg/gui/options_menu_panel.go | 3 +-- pkg/gui/popup/fake_popup_handler.go | 2 +- pkg/i18n/chinese.go | 1 + pkg/i18n/dutch.go | 1 + pkg/i18n/english.go | 2 ++ pkg/i18n/japanese.go | 1 + pkg/i18n/polish.go | 1 + 10 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index d6f4c1928..e51e5d47c 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -52,7 +52,7 @@ func Run(config config.AppConfigurer, common *common.Common, filterPath string) stackTrace := newErr.ErrorStack() app.Log.Error(stackTrace) - log.Fatal(fmt.Sprintf("%s: %s\n\n%s", common.Tr.ErrorOccurred, constants.Links.Issues, stackTrace)) + log.Fatalf("%s: %s\n\n%s", common.Tr.ErrorOccurred, constants.Links.Issues, stackTrace) } } diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go index c461af919..b413f6f5f 100644 --- a/pkg/gui/controllers/files_controller.go +++ b/pkg/gui/controllers/files_controller.go @@ -468,7 +468,7 @@ func (self *FilesController) handleAmendCommitPress() error { } return self.c.Confirm(types.ConfirmOpts{ - Title: strings.Title(self.c.Tr.AmendLastCommit), + Title: self.c.Tr.AmendLastCommitTitle, Prompt: self.c.Tr.SureToAmend, HandleConfirm: func() error { cmdObj := self.git.Commit.AmendHeadCmdObj() diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index bd36174bd..92deb664c 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -68,9 +68,8 @@ func (gui *Gui) layout(g *gocui.Gui) error { dimensionsObj.Y1+frameOffset, 0, ) - view.Frame = frame - if view != nil { + view.Frame = frame view.Visible = true } diff --git a/pkg/gui/options_menu_panel.go b/pkg/gui/options_menu_panel.go index 539d3f4d7..aee88d866 100644 --- a/pkg/gui/options_menu_panel.go +++ b/pkg/gui/options_menu_panel.go @@ -2,7 +2,6 @@ package gui import ( "log" - "strings" "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/gui/keybindings" @@ -79,7 +78,7 @@ func (gui *Gui) handleCreateOptionsMenu() error { }) return gui.c.Menu(types.CreateMenuOptions{ - Title: strings.Title(gui.c.Tr.LcMenu), + Title: gui.c.Tr.MenuTitle, Items: menuItems, HideCancel: true, }) diff --git a/pkg/gui/popup/fake_popup_handler.go b/pkg/gui/popup/fake_popup_handler.go index 08edd0e8a..95b0a3b1d 100644 --- a/pkg/gui/popup/fake_popup_handler.go +++ b/pkg/gui/popup/fake_popup_handler.go @@ -23,7 +23,7 @@ func (self *FakePopupHandler) Alert(title string, message string) error { } func (self *FakePopupHandler) Confirm(opts types.ConfirmOpts) error { - return self.Confirm(opts) + return self.OnConfirm(opts) } func (self *FakePopupHandler) Prompt(opts types.PromptOpts) error { diff --git a/pkg/i18n/chinese.go b/pkg/i18n/chinese.go index 65436eaeb..21097f7c4 100644 --- a/pkg/i18n/chinese.go +++ b/pkg/i18n/chinese.go @@ -54,6 +54,7 @@ func chineseTranslationSet() TranslationSet { PassUnameWrong: "密码 和/或 用户名错误", CommitChanges: "提交更改", AmendLastCommit: "修补最后一次提交", + AmendLastCommitTitle: "修补最后一次提交", SureToAmend: "您确定要修补上一次提交吗?之后您可以从提交面板更改提交消息。", NoCommitToAmend: "没有需要提交的修补。", CommitChangesWithEditor: "提交更改(使用编辑器编辑提交信息)", diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index e069d1be1..1ca2c530f 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -20,6 +20,7 @@ func dutchTranslationSet() TranslationSet { PassUnameWrong: "Wachtwoord en/of gebruikersnaam verkeerd", CommitChanges: "commit veranderingen", AmendLastCommit: "wijzig laatste commit", + AmendLastCommitTitle: "Wijzig Laatste Commit", SureToAmend: "Weet je zeker dat je de laatste commit wilt wijzigen? U kunt het commit-bericht wijzigen vanuit het commits-paneel.", NoCommitToAmend: "Er is geen commits om te wijzigen.", CommitChangesWithEditor: "commit veranderingen met de git editor", diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index ee14b8193..3b1d3aa6f 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -31,6 +31,7 @@ type TranslationSet struct { PassUnameWrong string CommitChanges string AmendLastCommit string + AmendLastCommitTitle string SureToAmend string NoCommitToAmend string CommitChangesWithEditor string @@ -652,6 +653,7 @@ func EnglishTranslationSet() TranslationSet { PassUnameWrong: "Password, passphrase and/or username wrong", CommitChanges: "commit changes", AmendLastCommit: "amend last commit", + AmendLastCommitTitle: "Amend Last Commit", SureToAmend: "Are you sure you want to amend last commit? Afterwards, you can change commit message from the commits panel.", NoCommitToAmend: "There's no commit to amend.", CommitChangesWithEditor: "commit changes using git editor", diff --git a/pkg/i18n/japanese.go b/pkg/i18n/japanese.go index a2b8eba0d..8bc366627 100644 --- a/pkg/i18n/japanese.go +++ b/pkg/i18n/japanese.go @@ -40,6 +40,7 @@ func japaneseTranslationSet() TranslationSet { PassUnameWrong: "パスワード, パスフレーズまたはユーザ名が間違っています。", CommitChanges: "変更をコミット", AmendLastCommit: "最新のコミットにamend", + AmendLastCommitTitle: "最新のコミットにamend", SureToAmend: "最新のコミットに変更をamendします。よろしいですか? コミットメッセージはコミットパネルから変更できます。", NoCommitToAmend: "amend可能なコミットが存在しません。", CommitChangesWithEditor: "gitエディタを使用して変更をコミット", diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 6b5026717..206f424c1 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -17,6 +17,7 @@ func polishTranslationSet() TranslationSet { PassUnameWrong: "Niewłaściwe hasło, fraza lub nazwa użytkownika", CommitChanges: "Zatwierdź zmiany", AmendLastCommit: "Zmień ostatni commit", + AmendLastCommitTitle: "Zmień Ostatni Commit", SureToAmend: "Czy na pewno chcesz zmienić ostatni commit? Możesz zmienić komunikat commitu z panelu commitów.", NoCommitToAmend: "Brak commitów do zmiany.", CommitChangesWithEditor: "Zatwierdź zmiany używając edytora",