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

Method manual_edit

commitizen/commands/commit.py:103–117  ·  view source on GitHub ↗
(self, message: str)

Source from the content-addressed store, hash-verified

101 )
102
103 def manual_edit(self, message: str) -> str:
104 editor = git.get_core_editor()
105 if editor is None:
106 raise RuntimeError("No 'editor' value given and no default available.")
107 exec_path = shutil.which(editor)
108 if exec_path is None:
109 raise RuntimeError(f"Editor '{editor}' not found.")
110 with tempfile.NamedTemporaryFile(mode="w", delete=False) as file:
111 file.write(message)
112 file_path = file.name
113 argv = [exec_path, file_path]
114 subprocess.call(argv)
115 message = Path(file_path).read_text().strip()
116 os.unlink(file.name)
117 return message
118
119 def _get_message(self) -> str:
120 if self.arguments.get("retry"):

Callers 2

test_manual_editFunction · 0.95
__call__Method · 0.95

Calls

no outgoing calls

Tested by 1

test_manual_editFunction · 0.76