Format commit errors.
(
self, invalid_commits: list[tuple[git.GitCommit, list]]
)
| 147 | ) |
| 148 | |
| 149 | def format_exception_message( |
| 150 | self, invalid_commits: list[tuple[git.GitCommit, list]] |
| 151 | ) -> str: |
| 152 | """Format commit errors.""" |
| 153 | displayed_msgs_content = "\n".join( |
| 154 | [ |
| 155 | f'commit "{commit.rev}": "{commit.message}\n"' + "\n".join(errors) |
| 156 | for commit, errors in invalid_commits |
| 157 | ] |
| 158 | ) |
| 159 | # TODO: capitalize the first letter of the error message for consistency in v5 |
| 160 | return ( |
| 161 | "commit validation: failed!\n" |
| 162 | "please enter a commit message in the commitizen format.\n" |
| 163 | f"{displayed_msgs_content}" |
| 164 | ) |