MCPcopy Create free account
hub / github.com/LunaSource/Luna / processNextFile

Function processNextFile

ui/models.go:169–202  ·  view source on GitHub ↗
(m CommitUI)

Source from the content-addressed store, hash-verified

167}
168
169func processNextFile(m CommitUI) tea.Cmd {
170 if m.currentFile >= len(m.files) {
171 return nil
172 }
173
174 file := m.files[m.currentFile]
175
176 return func() tea.Msg {
177 diff, err := git.GetFileDiff(file)
178 if err != nil {
179 return fileProcessedMsg{filename: file, result: "", err: err}
180 }
181
182 commitMsg := git.GenerateCommitMessage(
183 m.cfg.ApiKey,
184 diff,
185 file,
186 m.cfg,
187 m.includeEmoji,
188 )
189
190 m.commitMsgs[file] = commitMsg
191
192 return fileProcessedMsg{
193 filename: file,
194 result: "Commit message generated",
195 err: nil,
196 }
197 }
198}
199
200func (m CommitUI) View() string {
201 var b strings.Builder
202
203 now := time.Now().Format("15:04:05")
204 header := style.TitleStyle.Render(style.IconMoon + " Luna Commits " + style.IconAngleRight + " " + now)
205

Callers 2

UpdateMethod · 0.85
handleReviewInputFunction · 0.85

Calls 3

ShouldIgnoreFileFunction · 0.92
GetFileDiffFunction · 0.92
GenerateCommitMessageFunction · 0.92

Tested by

no test coverage detected