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

+4 -2
View File
@@ -38,8 +38,10 @@ class CommitGenGitService(GitService):
def commit_changes(self, message: str, sign: bool = False) -> None:
"""Commit changes with the given message."""
if not self.commit(message, sign=sign):
raise Exception("Failed to commit changes")
ok, stdout, stderr, code = self.commit_verbose(message, sign=sign)
if not ok:
details = stderr or stdout or f"exit code {code}"
raise Exception(f"Failed to commit changes: {details}")
def push_changes(self) -> None:
"""Push changes to the current branch."""