feat: Introduce isort and Python-based code quality tools (#446)

This commit is contained in:
Jens Bergmann
2025-03-10 06:09:49 +01:00
committed by GitHub
parent 4243ba698a
commit cfe2b900c7
5 changed files with 132 additions and 2 deletions

18
scripts/git_utils.py Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
"""Utility functions for git operations."""
import subprocess
from collections.abc import Sequence
def get_modified_python_files() -> Sequence[str]:
"""Get list of modified Python files from git.
Returns:
Sequence[str]: List of modified Python file paths
"""
git_cmd = ['git', 'diff', '--name-only', '--diff-filter=ACMR', 'HEAD']
result = subprocess.run(git_cmd, capture_output=True, text=True, check=True)
if not result.stdout.strip():
return []
return [f for f in result.stdout.splitlines() if f.endswith('.py')]