refactor: Improve test file filtering logic in blame script

This commit is contained in:
Paul Gauthier (aider) 2025-02-07 10:57:38 -08:00
parent 3f80a113d1
commit 2425322e8d

View file

@ -32,15 +32,18 @@ def blame(start_tag, end_tag=None):
revision = end_tag if end_tag else "HEAD"
files = run(["git", "ls-tree", "-r", "--name-only", revision]).strip().split("\n")
test_files = [
f for f in files
if f.startswith("tests/fixtures/languages/") and "/test." in f
]
files = [
f
for f in files
if f.endswith((".js", ".py", ".scm", ".sh", "Dockerfile", "Gemfile"))
or (f.startswith(".github/workflows/") and f.endswith(".yml"))
or f in website_files
or f in test_files
]
# Include all language test files
files.extend(f for f in files if f.startswith("tests/fixtures/languages/") and "/test." in f)
files = [f for f in files if not f.endswith("prompts.py")]
files = [f for f in files if not f.startswith("tests/fixtures/watch")]
files = [f for f in files if f not in exclude_files]