@@ -45,22 +45,30 @@ var (
4545
4646func init () {
4747 commitCmd .PersistentFlags ().StringP ("file" , "f" , "" , "specify output file for commit message" )
48- commitCmd .PersistentFlags ().BoolVar (& preview , "preview" , false , "preview commit message before committing" )
48+ commitCmd .PersistentFlags ().
49+ BoolVar (& preview , "preview" , false , "preview commit message before committing" )
4950 commitCmd .PersistentFlags ().IntVar (& diffUnified , "diff_unified" , 3 ,
5051 "generate diffs with <n> lines of context (default: 3)" )
51- commitCmd .PersistentFlags ().StringVar (& commitModel , "model" , "gpt-4o" , "specify which OpenAI model to use for generation" )
52- commitCmd .PersistentFlags ().StringVar (& commitLang , "lang" , "en" , "set output language for the commit message (default: English)" )
52+ commitCmd .PersistentFlags ().
53+ StringVar (& commitModel , "model" , "gpt-4o" , "specify which OpenAI model to use for generation" )
54+ commitCmd .PersistentFlags ().
55+ StringVar (& commitLang , "lang" , "en" , "set output language for the commit message (default: English)" )
5356 commitCmd .PersistentFlags ().StringSliceVar (& excludeList , "exclude_list" , []string {},
5457 "specify files to exclude from git diff" )
5558 commitCmd .PersistentFlags ().StringVar (& httpsProxy , "proxy" , "" , "set HTTP proxy URL" )
5659 commitCmd .PersistentFlags ().StringVar (& socksProxy , "socks" , "" , "set SOCKS proxy URL" )
57- commitCmd .PersistentFlags ().StringVar (& templateFile , "template_file" , "" , "provide template file for commit message format" )
58- commitCmd .PersistentFlags ().StringVar (& templateString , "template_string" , "" , "provide inline template string for commit message format" )
59- commitCmd .PersistentFlags ().StringSliceVar (& templateVars , "template_vars" , []string {}, "define custom variables for templates" )
60- commitCmd .PersistentFlags ().StringVar (& templateVarsFile , "template_vars_file" , "" , "specify file containing template variables" )
60+ commitCmd .PersistentFlags ().
61+ StringVar (& templateFile , "template_file" , "" , "provide template file for commit message format" )
62+ commitCmd .PersistentFlags ().
63+ StringVar (& templateString , "template_string" , "" , "provide inline template string for commit message format" )
64+ commitCmd .PersistentFlags ().
65+ StringSliceVar (& templateVars , "template_vars" , []string {}, "define custom variables for templates" )
66+ commitCmd .PersistentFlags ().
67+ StringVar (& templateVarsFile , "template_vars_file" , "" , "specify file containing template variables" )
6168 commitCmd .PersistentFlags ().BoolVar (& commitAmend , "amend" , false ,
6269 "amend the previous commit instead of creating a new one" )
63- commitCmd .PersistentFlags ().DurationVarP (& timeout , "timeout" , "t" , defaultTimeout , "set API request timeout duration" )
70+ commitCmd .PersistentFlags ().
71+ DurationVarP (& timeout , "timeout" , "t" , defaultTimeout , "set API request timeout duration" )
6472 commitCmd .PersistentFlags ().BoolVar (& promptOnly , "prompt_only" , false ,
6573 "display the prompt without sending to OpenAI" )
6674 commitCmd .PersistentFlags ().BoolVar (& noConfirm , "no_confirm" , false ,
@@ -196,7 +204,10 @@ var commitCmd = &cobra.Command{
196204 }
197205
198206 // Lowercase the first character of first word of the commit message and remove the trailing period
199- summarizeTitle = strings .TrimRight (strings .ToLower (string (summarizeTitle [0 ]))+ summarizeTitle [1 :], "." )
207+ summarizeTitle = strings .TrimRight (
208+ strings .ToLower (string (summarizeTitle [0 ]))+ summarizeTitle [1 :],
209+ "." ,
210+ )
200211 data [prompt .SummarizeTitleKey ] = strings .TrimSpace (summarizeTitle )
201212 }
202213
@@ -268,7 +279,11 @@ var commitCmd = &cobra.Command{
268279 }
269280
270281 // Translate git commit message
271- color .Cyan ("Translating git commit message to " + prompt .GetLanguage (viper .GetString ("output.lang" )))
282+ color .Cyan (
283+ "Translating git commit message to " + prompt .GetLanguage (
284+ viper .GetString ("output.lang" ),
285+ ),
286+ )
272287 resp , err := client .Completion (cmd .Context (), out )
273288 if err != nil {
274289 return err
@@ -306,7 +321,8 @@ var commitCmd = &cobra.Command{
306321 if noConfirm {
307322 return nil
308323 }
309- if ready , err := confirmation .New ("Commit this preview summary?" , confirmation .Yes ).RunPrompt (); err != nil || ! ready {
324+ if ready , err := confirmation .New ("Commit this preview summary?" , confirmation .Yes ).RunPrompt (); err != nil ||
325+ ! ready {
310326 if err != nil {
311327 return err
312328 }
0 commit comments