INNER CODE UNIT · Python
get_changed_files
panther-labs/panther-analysis · .scripts/claude_review.py:40
def get_changed_files():
"""Get reviewable staged files."""
output = run_git("diff", "--cached", "--name-only", "--diff-filter=ACMR")
if not output:
return []
files = []
for f in output.splitlines():
path = Path(f)
if path.suffix in REVIEW_EXTENSIONS and not EXCLUDE_PATTERNS.search(f):
files.append(f)
if len(files) >= MAX_FILES:
break
return files
def read_file_contents(files):
"""Read staged contents of each file (from git index, not working tree)."""