renderGodepFilesError formats commits and their file lists into readable output prefixed with label.
(label string, commits []util.Commit, opt CommitFilesRenderOption)
| 214 | // renderGodepFilesError formats commits and their file lists into readable |
| 215 | // output prefixed with label. |
| 216 | func renderGodepFilesError(label string, commits []util.Commit, opt CommitFilesRenderOption) string { |
| 217 | msg := fmt.Sprintf("%s:\n\n", label) |
| 218 | for _, commit := range commits { |
| 219 | msg += fmt.Sprintf("[%s] %s\n", commit.Sha, commit.Summary) |
| 220 | if opt == RenderNoFiles { |
| 221 | continue |
| 222 | } |
| 223 | for _, file := range commit.Files { |
| 224 | if opt == RenderAllFiles || |
| 225 | (opt == RenderOnlyGodepsFiles && file.HasVendoredCodeChanges()) || |
| 226 | (opt == RenderOnlyNonGodepsFiles && !file.HasVendoredCodeChanges()) { |
| 227 | msg += fmt.Sprintf(" - %s\n", file) |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | return msg |
| 232 | } |
no test coverage detected