Skip to content

Commit 772b49d

Browse files
[Penify]: Documentation for commit - 306de81
1 parent 306de81 commit 772b49d

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

penify_hook/commit_analyzer.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ def run(self, msg: Optional[str], edit_commit_message: bool):
8888
and processes each file. It stages any files that have been modified
8989
during processing and creates an auto-commit if changes were made. A
9090
progress bar is displayed to indicate the processing status of each
91-
file.
91+
file. If there is an error generating the commit summary, an exception
92+
is raised.
93+
94+
Args:
95+
msg (Optional[str]): An optional message to include in the commit.
96+
edit_commit_message (bool): A flag indicating whether to open the
97+
git commit edit terminal after committing.
98+
99+
Raises:
100+
Exception: If there is an error generating the commit summary.
92101
"""
93102
summary: dict = self.get_summary(msg)
94103
if not summary:
@@ -106,11 +115,12 @@ def run(self, msg: Optional[str], edit_commit_message: bool):
106115

107116

108117
def _amend_commit(self):
109-
"""
110-
Open the default git editor for editing the commit message.
111-
112-
Args:
113-
initial_message (str): The initial commit message to populate the editor with.
118+
"""Open the default git editor for editing the commit message.
119+
120+
This function changes the current working directory to the repository
121+
path, runs the git command to amend the last commit, and opens the
122+
default editor for the user to modify the commit message. After the
123+
operation, it returns to the original directory.
114124
"""
115125
try:
116126
# Change to the repository directory

0 commit comments

Comments
 (0)