Skip to content

Commit acdc10c

Browse files
committed
style(cmd): remove redundant newlines from error messages
- Eliminate unnecessary `fmt.Println()` calls that added extra newlines after error messages. [Generated by Kommit]
1 parent 5c145e3 commit acdc10c

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

cmd/init.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func runInit(cmd *cobra.Command, args []string) {
4141
config, err = utils.GetDefaultConfig()
4242
if err != nil {
4343
fmt.Println("😰 Therapy session interrupted: Failed to retrieve your treatment plan.")
44-
fmt.Println()
4544
if Verbose {
4645
log.Printf("Error getting default config: %v", err)
4746
}
@@ -61,7 +60,6 @@ func runInit(cmd *cobra.Command, args []string) {
6160
_, model, err := prompt.Run()
6261
if err != nil {
6362
fmt.Println("😰 Therapy session interrupted: Failed to select your therapist.")
64-
fmt.Println()
6563
if Verbose {
6664
log.Printf("Error selecting model: %v", err)
6765
}
@@ -81,7 +79,6 @@ func runInit(cmd *cobra.Command, args []string) {
8179
filenames, err := utils.GetFilesFromDirectory(5)
8280
if err != nil {
8381
fmt.Println("😰 Therapy session interrupted: Failed to retrieve your relationship history.")
84-
fmt.Println()
8582
if Verbose {
8683
log.Printf("Error getting scopes from directory: %v", err)
8784
}
@@ -92,7 +89,6 @@ func runInit(cmd *cobra.Command, args []string) {
9289
scopes, err := llm.GenerateScopesFromFilenames(model, filenames, existingScopes)
9390
if err != nil {
9491
fmt.Println("😰 Therapy session interrupted: Failed to establish your treatment plan.")
95-
fmt.Println()
9692
if Verbose {
9793
log.Printf("Error generating scopes from directory: %v", err)
9894
}
@@ -104,7 +100,6 @@ func runInit(cmd *cobra.Command, args []string) {
104100
err = utils.WriteConfig(config)
105101
if err != nil {
106102
fmt.Println("😰 Therapy session interrupted: Failed to write your treatment plan.")
107-
fmt.Println()
108103
if Verbose {
109104
log.Printf("Error writing config: %v", err)
110105
}
@@ -113,7 +108,6 @@ func runInit(cmd *cobra.Command, args []string) {
113108

114109
fmt.Println("🥹 Your repo is in therapy! Treatment plan filled successfully.")
115110
fmt.Println("🥰 Run `kommit commit` to continue the healing process!")
116-
fmt.Println()
117111
utils.PrintConfigFile()
118112
os.Exit(0)
119113
}

cmd/root.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func runCommit(cmd *cobra.Command, args []string) {
4343
if err != nil || diff == "" {
4444
fmt.Println("😰 Commitment issues detected: You're not ready to commit... anything.")
4545
fmt.Println("(Stage some changes first!)")
46-
fmt.Println()
4746
os.Exit(1)
4847
}
4948

@@ -52,7 +51,6 @@ func runCommit(cmd *cobra.Command, args []string) {
5251
if err != nil {
5352
fmt.Println("😰 Commitment issues detected: You haven't booked your first therapy session!")
5453
fmt.Println("(Run 'git kommit init' to get on the calendar.)")
55-
fmt.Println()
5654
if Verbose {
5755
log.Printf("Error loading config: %v", err)
5856
}
@@ -110,7 +108,6 @@ func runCommit(cmd *cobra.Command, args []string) {
110108
tempFile, err := os.CreateTemp("", ".kommit-msg-*.txt")
111109
if err != nil {
112110
fmt.Println("😰 Commitment issues detected: Refusing to prepare temporary paperwork!")
113-
fmt.Println()
114111
if Verbose {
115112
log.Printf("Error creating temp file: %v", err)
116113
}
@@ -122,7 +119,6 @@ func runCommit(cmd *cobra.Command, args []string) {
122119
if _, err := tempFile.WriteString(commitMessage); err != nil {
123120
tempFile.Close()
124121
fmt.Println("😰 Commitment issues detected: Refusing to fill the temporary paperwork!")
125-
fmt.Println()
126122
if Verbose {
127123
log.Printf("Error writing to temp file: %v", err)
128124
}
@@ -138,7 +134,6 @@ func runCommit(cmd *cobra.Command, args []string) {
138134
err = cmd.Run()
139135
if err != nil {
140136
fmt.Println("😰 Commitment issues detected: Refusing to commit!")
141-
fmt.Println()
142137
if Verbose {
143138
log.Printf("Error committing: %v", err)
144139
}
@@ -151,7 +146,6 @@ func runCommit(cmd *cobra.Command, args []string) {
151146
tempFile, err := os.CreateTemp("", ".kommit-msg-*.txt")
152147
if err != nil {
153148
fmt.Println("😰 Commitment issues detected: Couldn't prepare your self-therapy materials!")
154-
fmt.Println()
155149
if Verbose {
156150
log.Printf("Error creating temp file: %v", err)
157151
}
@@ -164,7 +158,6 @@ func runCommit(cmd *cobra.Command, args []string) {
164158
if _, err := tempFile.WriteString(commitMessage); err != nil {
165159
tempFile.Close()
166160
fmt.Println("😰 Commitment issues detected: Couldn't write your therapy starting notes!")
167-
fmt.Println()
168161
if Verbose {
169162
log.Printf("Error writing to temp file: %v", err)
170163
}
@@ -194,7 +187,6 @@ func runCommit(cmd *cobra.Command, args []string) {
194187
runCommit(cmd, args)
195188
case " No, I'm terminating this therapy session (exit)":
196189
fmt.Println("🧐 You're on your own path now. Call if your commitment issues return!")
197-
fmt.Println()
198190
os.Exit(0)
199191
}
200192
}

0 commit comments

Comments
 (0)