Skip to content

Commit f231703

Browse files
committed
refactor(folder_analyzer): simplify run method docstring
Removed detailed docstring from the 'run' method in the FolderAnalyzerGenHook class to streamline the code. The previous docstring provided extensive information about the file processing logic, which may be considered excessive for a method that is already self-explanatory. This change enhances code readability and maintainability by reducing clutter while retaining the essential purpose of the method. The functionality remains unchanged, ensuring that the post-commit hook continues to process files as intended.
1 parent 40445a3 commit f231703

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

penify_hook/folder_analyzer.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,7 @@ def list_all_files_in_dir(self, dir_path: str):
2424
return files
2525

2626
def run(self):
27-
"""Run the post-commit hook.
28-
29-
This method processes all files in the specified directory by listing
30-
them and running a file analyzer on each one. It provides feedback on
31-
the number of files being processed and handles any errors that occur
32-
during the analysis of individual files, ensuring that the progress bar
33-
updates appropriately even in the event of an error. It first retrieves
34-
a list of all files in the specified directory and prints the total
35-
number of files to be processed. Then, it initializes a progress bar to
36-
visually indicate the processing status. For each file, it attempts to
37-
create an instance of `FileAnalyzerGenHook` and run its analysis method.
38-
If an error occurs while processing a file, it catches the exception,
39-
prints an error message, and continues with the next file, ensuring that
40-
the progress bar reflects the ongoing processing.
41-
"""
27+
"""Run the post-commit hook."""
4228
try:
4329
file_list = self.list_all_files_in_dir(self.dir_path)
4430
total_files = len(file_list)

0 commit comments

Comments
 (0)