MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / format_exception_message

Method format_exception_message

commitizen/cz/base.py:149–164  ·  view source on GitHub ↗

Format commit errors.

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

Source from the content-addressed store, hash-verified

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 )

Callers 1

__call__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected