From dc9c3407d179c4b95372346f3b01e88a8cf5bc14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 19:13:07 +0000 Subject: [PATCH] Revert PYTHON-5768: restore copilot-instructions.md and remove AGENTS.md Agent-Logs-Url: https://github.com/mongodb/mongo-python-driver/sessions/9c84412d-17da-48e6-8a7e-8e13f12d7142 Co-authored-by: aclark4life <72164+aclark4life@users.noreply.github.com> --- .github/copilot-instructions.md | 45 +++++++++++++++++++++++++++++++-- AGENTS.md | 44 -------------------------------- 2 files changed, 43 insertions(+), 46 deletions(-) delete mode 100644 AGENTS.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a8943d11ac..b67cb49aca 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,3 +1,44 @@ -Please see [AGENTS.md](../AGENTS.md). +When reviewing code, focus on: -Follow the repository instructions defined in `AGENTS.md` when working in this codebase. +## Security Critical Issues +- Check for hardcoded secrets, API keys, or credentials. +- Check for instances of potential method call injection, dynamic code execution, symbol injection or other code injection vulnerabilities. + +## Performance Red Flags +- Spot inefficient loops and algorithmic issues. +- Check for memory leaks and resource cleanup. + +## Code Quality Essentials +- Methods should be focused and appropriately sized. If a method is doing too much, suggest refactorings to split it up. +- Use clear, descriptive naming conventions. +- Avoid encapsulation violations and ensure proper separation of concerns. +- All public classes, modules, and methods should have clear documentation in Sphinx format. + +## PyMongo-specific Concerns +- Do not review files within `pymongo/synchronous` or files in `test/` that also have a file of the same name in `test/asynchronous` unless the reviewed changes include a `_IS_SYNC` statement. PyMongo generates these files from `pymongo/asynchronous` and `test/asynchronous` using `tools/synchro.py`. +- All asynchronous functions must not call any blocking I/O. + +## Review Style +- Be specific and actionable in feedback. +- Explain the "why" behind recommendations. +- Acknowledge good patterns when you see them. +- Ask clarifying questions when code intent is unclear. + +Always prioritize security vulnerabilities and performance issues that could impact users. + +Always suggest changes to improve readability and testability. For example, this suggestion seeks to make the code more readable, reusable, and testable: + +```python +# Instead of: +if user.email and "@" in user.email and len(user.email) > 5: + submit_button.enabled = True +else: + submit_button.enabled = False + +# Consider: +def valid_email(email): + return email and "@" in email and len(email) > 5 + + +submit_button.enabled = valid_email(user.email) +``` diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index b67cb49aca..0000000000 --- a/AGENTS.md +++ /dev/null @@ -1,44 +0,0 @@ -When reviewing code, focus on: - -## Security Critical Issues -- Check for hardcoded secrets, API keys, or credentials. -- Check for instances of potential method call injection, dynamic code execution, symbol injection or other code injection vulnerabilities. - -## Performance Red Flags -- Spot inefficient loops and algorithmic issues. -- Check for memory leaks and resource cleanup. - -## Code Quality Essentials -- Methods should be focused and appropriately sized. If a method is doing too much, suggest refactorings to split it up. -- Use clear, descriptive naming conventions. -- Avoid encapsulation violations and ensure proper separation of concerns. -- All public classes, modules, and methods should have clear documentation in Sphinx format. - -## PyMongo-specific Concerns -- Do not review files within `pymongo/synchronous` or files in `test/` that also have a file of the same name in `test/asynchronous` unless the reviewed changes include a `_IS_SYNC` statement. PyMongo generates these files from `pymongo/asynchronous` and `test/asynchronous` using `tools/synchro.py`. -- All asynchronous functions must not call any blocking I/O. - -## Review Style -- Be specific and actionable in feedback. -- Explain the "why" behind recommendations. -- Acknowledge good patterns when you see them. -- Ask clarifying questions when code intent is unclear. - -Always prioritize security vulnerabilities and performance issues that could impact users. - -Always suggest changes to improve readability and testability. For example, this suggestion seeks to make the code more readable, reusable, and testable: - -```python -# Instead of: -if user.email and "@" in user.email and len(user.email) > 5: - submit_button.enabled = True -else: - submit_button.enabled = False - -# Consider: -def valid_email(email): - return email and "@" in email and len(email) > 5 - - -submit_button.enabled = valid_email(user.email) -```