MCPcopy Index your code
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 if git.ShouldIgnoreFile(file, m.cfg) {
178 return fileProcessedMsg{filename: file, result: "Ignored", err: nil}
179 }
180
181 diff, err := git.GetFileDiff(file)
182 if err != nil {
183 return fileProcessedMsg{filename: file, result: "", err: err}
184 }
185
186 commitMsg := git.GenerateCommitMessage(
187 m.cfg.ApiKey,
188 diff,
189 file,
190 m.cfg,
191 m.includeEmoji,
192 )
193
194 m.commitMsgs[file] = commitMsg
195
196 return fileProcessedMsg{
197 filename: file,
198 result: "Commit message generated",
199 err: nil,
200 }
201 }
202}
203
204func (m CommitUI) View() string {
205 var b strings.Builder

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