-
Notifications
You must be signed in to change notification settings - Fork 406
Create generated-code.instructions.md for copilot #9656
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
base: master
Are you sure you want to change the base?
Conversation
Instruct copilot to review generated code better than it does today.
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.
Pull Request Overview
This PR adds documentation guidelines for reviewing generated code in the repository. The document establishes rules to avoid stylistic suggestions on generated code while still reporting actual errors.
- Defines which files contain generated code (*.gen.go, clients/java, clients/python, clients/rust)
- Establishes that only actual errors (not stylistic issues) should be reported in generated code
- Provides examples distinguishing harmless generated code from security vulnerabilities
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Examples | ||
|
|
||
| #### Not an error, do NOT report suggest a fix |
Copilot
AI
Nov 10, 2025
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.
Grammatical error: "do NOT report suggest a fix" should be "do NOT report or suggest a fix"
| #### Not an error, do NOT report suggest a fix | |
| #### Not an error, do NOT report or suggest a fix |
| sql_statement = s"SELECT $columns FROM $table LIMIT 1" | ||
| ``` | ||
|
|
||
| then it may be susceptible to SQL injection. Report it unless variables `column` and `table` are very clearly safe to use. |
Copilot
AI
Nov 10, 2025
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.
Inconsistent variable naming: The text refers to "variables column and table" but the code example uses $columns and $table. The variable name should be columns (plural) to match the code.
| then it may be susceptible to SQL injection. Report it unless variables `column` and `table` are very clearly safe to use. | |
| then it may be susceptible to SQL injection. Report it unless variables `columns` and `table` are very clearly safe to use. |
nopcoder
left a comment
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.
Instruct copilot to review generated code better than it does today.
(The "do not" example actually occurred today, and I don't like it).