diff --git a/scripts/lint-commit.py b/scripts/lint-commit.py index a424e43..a37ed4f 100644 --- a/scripts/lint-commit.py +++ b/scripts/lint-commit.py @@ -23,7 +23,9 @@ import sys from pathlib import Path -def run_command(cmd, check=True): +def run_command( + cmd: list[str], check: bool = True +) -> subprocess.CompletedProcess[str] | subprocess.CalledProcessError: """Run a shell command and return the result.""" try: result = subprocess.run(cmd, capture_output=True, text=True, check=check) @@ -46,7 +48,11 @@ def check_gitlint_installed(): sys.exit(1) -def lint_commit(commit_hash=None, commit_range=None, staged=False): +def lint_commit( + commit_hash: str | None = None, + commit_range: str | None = None, + staged: bool = False, +) -> bool: """Lint commit message(s) using gitlint.""" # Build gitlint command cmd = ["gitlint"]