Using GitHub Copilot for code reviews: from VS Code to github.com

GitHubAbout 3 min readJul 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • GitHub Copilot Code Review: An AI-powered tool for automated code review.
  • Pull Request (PR): A request to merge code changes into a main branch.
  • Copilot Instructions File: A configuration file to customize Copilot's review behavior.
  • Commit Suggestion: Copilot's proposed code changes that can be applied with a single click.

Code Review in Visual Studio Code

The video demonstrates using GitHub Copilot to review code directly within Visual Studio Code before creating a commit. The user has an open project with changes ready to be committed. Instead of immediately committing, they leverage Copilot to get initial feedback on the code. Copilot analyzes the code and provides suggestions for improvement across multiple files. The video highlights that Copilot identifies issues such as:

  • Logic bugs
  • Unclear error messages
  • Insecure coding patterns
  • Deviations from coding guidelines

The user can then apply these suggested changes directly within the code editor, streamlining the development process.

Code Review on GitHub.com (Pull Requests)

The video then transitions to showcasing Copilot's code review capabilities on GitHub.com within the context of a pull request. The same code from the Visual Studio Code example is used in a newly opened pull request. The key point here is that Copilot can be assigned to review the pull request before involving human reviewers (team members or maintainers). This saves valuable time for human reviewers by filtering out initial issues. The video mentions the option to automatically assign Copilot to all or some new pull requests.

Copilot's Feedback and Suggestions

After being assigned, Copilot adds comments directly to the pull request. The example shows comments related to:

  • Writing more efficient code
  • Error handling

Crucially, Copilot provides specific suggestions that can be applied with a single click using the "commit suggestion" button. This allows for quick and easy incorporation of Copilot's recommendations.

Customizing Copilot's Review with Copilot Instructions File

The video emphasizes that Copilot's review behavior can be customized using a "copilot-instructions" file within the repository. This file allows developers to shape how Copilot will review the code, ensuring it aligns with specific project requirements and coding standards.

Iterative Review Process

The video concludes by highlighting the iterative nature of the review process. After addressing Copilot's initial feedback, the user can re-request a review from Copilot to get a new round of suggestions. This allows for a continuous improvement cycle, ensuring code quality and adherence to best practices.

Synthesis/Conclusion

GitHub Copilot Code Review offers a powerful way to automate and enhance the code review process. By integrating directly into both Visual Studio Code and GitHub.com, it provides developers with actionable feedback early in the development cycle. The ability to customize Copilot's behavior with a "copilot-instructions" file and the iterative review process further enhance its value, leading to improved code quality and more efficient collaboration.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.