-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5768 Add AGENTS.md w/copilot instructions #2744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aclark4life
wants to merge
2
commits into
mongodb:master
Choose a base branch
from
aclark4life:PYTHON-5768
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−43
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,3 @@ | ||
| When reviewing code, focus on: | ||
| Please see [AGENTS.md](../AGENTS.md). | ||
|
|
||
| ## 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) | ||
| ``` | ||
| Follow the repository instructions defined in `AGENTS.md` when working in this codebase. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| 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) | ||
| ``` | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AGENTS.md starts with plain text rather than a top-level markdown header. Other repo-root docs (e.g., README.md:1 and CONTRIBUTING.md:1) start with an H1; adding an H1 here would make the document more consistent and easier to scan in rendered views/TOCs.