MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / format_exception_message

Method format_exception_message

commitizen/cz/base.py:195–210  ·  view source on GitHub ↗

Format commit errors.

(
        self, invalid_commits: list[tuple[git.GitCommit, list]]
    )

Source from the content-addressed store, hash-verified

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 )

Callers 1

__call__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected