Ignore only what the repo generates, in place of the allowlist
This commit is contained in:
@@ -124,7 +124,7 @@ class TheLauncher(unittest.TestCase):
|
||||
ran = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=60)
|
||||
self.assertEqual((ran.returncode, ran.stdout.split(" ", 2)[2]), (0, main.HELP + "\n"))
|
||||
tracked = subprocess.run(["git", "ls-files", "--error-unmatch", launcher.name], capture_output=True, cwd=launcher.parent)
|
||||
self.assertEqual(tracked.returncode, 0, "bin/build-epic is not in the repo; .gitignore lists what it keeps")
|
||||
self.assertEqual(tracked.returncode, 0, "bin/build-epic is not in the repo")
|
||||
|
||||
|
||||
class TheCommand(BuildEpicTest):
|
||||
|
||||
@@ -7,33 +7,22 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from repo_checks import ROOT
|
||||
|
||||
PRIVATE = [
|
||||
".claude/settings.local.json",
|
||||
".credentials.json",
|
||||
"auto-mode-transcripts/a.jsonl",
|
||||
"backups/.claude.json.backup.1",
|
||||
"daemon-auth-status.json",
|
||||
"daemon.log",
|
||||
"daemon/control.key",
|
||||
"debug/a.txt",
|
||||
"file-history/a/b.md",
|
||||
"history.jsonl",
|
||||
"jobs/a/b.json",
|
||||
"memory/MEMORY.md",
|
||||
"paste-cache/a.txt",
|
||||
"projects/-home-a/a.jsonl",
|
||||
"projects/-home-a/memory/MEMORY.md",
|
||||
"projects/-home-a/memory/a.md",
|
||||
"session-env/a/b.sh",
|
||||
"sessions/a.json",
|
||||
"shell-snapshots/a.sh",
|
||||
"tasks/a/b.json",
|
||||
GENERATED = [
|
||||
"bin/__pycache__/a.cpython-313.pyc",
|
||||
"bin/agent_cycle/__pycache__/a.cpython-313.pyc",
|
||||
"workflow-bench/a-1-1.md",
|
||||
"workflow-bench/a-1-1/README.md",
|
||||
"workflow-bench/compare/a/A1/fixes.diff",
|
||||
"workflow-bench/logs/a.jsonl",
|
||||
]
|
||||
|
||||
AUTHORED = [
|
||||
"bin/agent_cycle/run.py",
|
||||
"workflow-bench/advisor-judge-prompt.md",
|
||||
"workflow-bench/bench.py",
|
||||
"workflow-bench/setup.cfg",
|
||||
]
|
||||
|
||||
|
||||
class Gitignore(unittest.TestCase):
|
||||
def test_ignores_no_tracked_file(self):
|
||||
@@ -44,6 +33,10 @@ class Gitignore(unittest.TestCase):
|
||||
ignored = subprocess.run(["git", "ls-files", "-oi", "--exclude-standard", "--", "bin/*.py", "bin/**/*.py"], capture_output=True, check=True, cwd=ROOT, text=True).stdout
|
||||
self.assertEqual(ignored, "")
|
||||
|
||||
def test_ignores_every_private_file(self):
|
||||
ignored = subprocess.run(["git", "check-ignore", "--no-index", "--stdin"], capture_output=True, cwd=ROOT, input="\n".join(PRIVATE), text=True).stdout
|
||||
self.assertEqual(ignored.splitlines(), PRIVATE)
|
||||
def test_ignores_every_generated_file(self):
|
||||
ignored = subprocess.run(["git", "check-ignore", "--no-index", "--stdin"], capture_output=True, cwd=ROOT, input="\n".join(GENERATED), text=True).stdout
|
||||
self.assertEqual(ignored.splitlines(), GENERATED)
|
||||
|
||||
def test_ignores_no_authored_file(self):
|
||||
ignored = subprocess.run(["git", "check-ignore", "--no-index", "--stdin"], capture_output=True, cwd=ROOT, input="\n".join(AUTHORED), text=True).stdout
|
||||
self.assertEqual(ignored, "")
|
||||
|
||||
Reference in New Issue
Block a user