mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
feat: Introduce isort and Python-based code quality tools (#446)
This commit is contained in:
18
scripts/git_utils.py
Normal file
18
scripts/git_utils.py
Normal 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')]
|
||||
Reference in New Issue
Block a user