Skip to content

Commit 7c99fca

Browse files
art049claude
andcommitted
feat: add .gitignore to .codspeed folder on creation
Prevents local benchmark results from being accidentally committed. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 36f5930 commit 7c99fca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pytest_codspeed/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus):
310310
session.config.rootpath / f".codspeed/results_{time() * 1000:.0f}.json"
311311
)
312312
data = {**get_environment_metadata(), **plugin.instrument.get_result_dict()}
313+
created = not result_path.parent.exists()
313314
result_path.parent.mkdir(parents=True, exist_ok=True)
315+
if created:
316+
(result_path.parent / ".gitignore").write_text("*\n")
314317
result_path.write_text(json.dumps(data, indent=2))
315318

316319

0 commit comments

Comments
 (0)