Skip to content

Conversation

@arielshaqed
Copy link
Contributor

Instruct copilot to review generated code better than it does today.

(The "do not" example actually occurred today, and I don't like it).

Instruct copilot to review generated code better than it does today.
@arielshaqed arielshaqed requested review from a team and Copilot November 10, 2025 07:39
@arielshaqed arielshaqed added pr/merge-if-approved Reviewer: please feel free to merge if no major comments infrastructure build, deploy and release processes exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached area/ci labels Nov 10, 2025
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Nov 10, 2025

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"

Suggested change
#### Not an error, do NOT report suggest a fix
#### Not an error, do NOT report or suggest a fix

Copilot uses AI. Check for mistakes.
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.
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@nopcoder nopcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci exclude-changelog PR description should not be included in next release changelog infrastructure build, deploy and release processes minor-change Used for PRs that don't require issue attached pr/merge-if-approved Reviewer: please feel free to merge if no major comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants