PYTHON-5742 - Add Copilot instructions#2717
Open
NoahStapp wants to merge 3 commits intomongodb:masterfrom
Open
PYTHON-5742 - Add Copilot instructions#2717NoahStapp wants to merge 3 commits intomongodb:masterfrom
NoahStapp wants to merge 3 commits intomongodb:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a repository-level Copilot instruction file to guide automated code reviews toward security, performance, and PyMongo-specific conventions.
Changes:
- Introduces
.github/copilot-instructions.mdwith review focus areas (security, performance, code quality). - Adds PyMongo-specific guidance around synchro-generated files and async I/O.
- Includes an example refactor aimed at readability/testability.
Comments suppressed due to low confidence (2)
.github/copilot-instructions.md:43
- The Python example uses
email.contains(\"@\"), but Python strings don’t have a.contains()method. This makes the guidance misleading/incorrect. Update the example to use idiomatic Python (e.g.,\"@\" in email) and ensurevalid_emailreturns a strict boolean rather than potentially returningemailwhen falsy.
if user.email and user.email.contains("@") and len(user.email) > 5:
submit_button.enabled = True
else:
submit_button.enabled = False
# Consider:
def valid_email(email):
return email and email.contains("@") and len(email) > 5
submit_button.enabled = valid_email(user.email)
.github/copilot-instructions.md:1
- Consider making the opening line a top-level Markdown heading (e.g.,
# ...) or adding a heading above it. As-is, the file starts with plain text plus a colon, which reads a bit like an incomplete header and is less scannable in GitHub’s rendered view.
When reviewing code, focus on:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jibola
approved these changes
Mar 4, 2026
sleepyStick
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-5742
Changes in this PR
Add
copilot-instructions.mdfor improved Copilot code reviews.Test Plan
Checklist
Checklist for Author
Checklist for Reviewer