Format commit errors.
(
self, invalid_commits: list[tuple[git.GitCommit, list]]
)
| 193 | ) |
| 194 | |
| 195 | def format_exception_message( |
| 196 | self, invalid_commits: list[tuple[git.GitCommit, list]] |
| 197 | ) -> str: |
| 198 | """Format commit errors.""" |
| 199 | displayed_msgs_content = "\n".join( |
| 200 | [ |
| 201 | f'commit "{commit.rev}": "{commit.message}\n"' + "\n".join(errors) |
| 202 | for commit, errors in invalid_commits |
| 203 | ] |
| 204 | ) |
| 205 | # TODO: capitalize the first letter of the error message for consistency in v5 |
| 206 | return ( |
| 207 | "commit validation: failed!\n" |
| 208 | "please enter a commit message in the commitizen format.\n" |
| 209 | f"{displayed_msgs_content}" |
| 210 | ) |