Skip to main content

Utiliser la revue de code GitHub Copilot

Apprenez à demander une révision de code à partir de GitHub Copilot.

About Copilot code review

GitHub Copilot can review your code and provide feedback. Where possible, Copilot's feedback includes suggested changes which you can apply with a couple of clicks.

Validating Copilot code reviews

Avertissement

Copilot isn't guaranteed to spot all problems or issues in a pull request, and sometimes it will make mistakes. Always validate Copilot's feedback carefully, and supplement Copilot's feedback with a human review.

For more information, see Responsible use of GitHub Copilot code review.

Requesting a review from Copilot

These instructions explain how to use Copilot code review in Visual Studio. To see instructions for other popular coding environments, use the tool switcher at the top of the page.

To use Copilot code review, you must use Visual Studio version 17.14 or later. See the Visual Studio downloads page.

  1. In the Git Changes window, click Review changes with Copilot. This button appears as a comment icon with a sparkle.

  2. Copilot will begin reviewing your changes. After a few moments, a link showing the number of code review comments appears in the Git Changes window.

  3. Click the link to view and navigate the comments. If no issues are found, you’ll see the message: Copilot did not comment on any files.

  4. Copilot displays comments in your code with a summary of each potential issue. You can:

    • Review and make changes based on the suggestions.
    • Dismiss a comment using the downward arrow in the top-right corner of the comment box.
  5. To remove all review comments, click next to the code review link in the Git Changes window.

For more information on enabling and configuring Copilot code review in Visual Studio, see Review local changes with Copilot Chat in the Visual Studio documentation.