feat(hooks): add git hooks management and auto-fix on pre-commit

This commit is contained in:
sankalp committed 2025-08-25 14:29:08 +05:45
1 parent 0036e47968
commit 3a7da276b4
7 files changed
+201 -20

No files matched your search

+17 -2
View File
@@ -76,8 +76,23 @@ class GitService:
if sign:
args.append("-S")
args.extend(["-m", message])
stdout, stderr, _ = self._run_git_command(args)
return not stderr
stdout, stderr, returncode = self._run_git_command(args)
return returncode == 0
def commit_verbose(
self, message: str, sign: bool = False
) -> Tuple[bool, str, str, int]:
"""Create a commit and return success and raw outputs.
Returns:
(ok, stdout, stderr, returncode)
"""
args = ["commit"]
if sign:
args.append("-S")
args.extend(["-m", message])
stdout, stderr, returncode = self._run_git_command(args)
return returncode == 0, stdout, stderr, returncode
def get_repo_name(self) -> str:
"""Get the repository name."""